summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/compositor/gpu_process_transport_factory.cc4
-rw-r--r--content/browser/dom_storage/dom_storage_database.cc2
-rw-r--r--content/browser/gpu/compositor_util.cc25
-rw-r--r--content/browser/indexed_db/indexed_db_leveldb_coding.cc29
-rw-r--r--content/browser/renderer_host/input/gesture_event_queue.cc5
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc5
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.cc6
-rw-r--r--content/child/child_thread.cc6
-rw-r--r--content/child/indexed_db/indexed_db_key_builders.cc14
-rw-r--r--content/child/npapi/webplugin_delegate_impl.cc1
-rw-r--r--content/child/webcrypto/jwk.cc7
-rw-r--r--content/common/content_paths.cc2
-rw-r--r--content/common/content_switches_internal.cc4
-rw-r--r--content/common/indexed_db/indexed_db_key.cc2
-rw-r--r--content/common/indexed_db/indexed_db_param_traits.cc11
-rw-r--r--content/common/page_state_serialization_unittest.cc9
-rw-r--r--content/renderer/media/webrtc_audio_device_impl.cc7
-rw-r--r--content/shell/renderer/test_runner/TestPlugin.cpp3
-rw-r--r--content/test/mock_webclipboard_impl.cc14
19 files changed, 49 insertions, 107 deletions
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 56a9cb4..bc9f7ec 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -174,10 +174,10 @@ scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
#elif defined(USE_X11)
return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceX11(
compositor));
-#endif
-
+#else
NOTREACHED();
return scoped_ptr<cc::SoftwareOutputDevice>();
+#endif
}
scoped_ptr<cc::OutputSurface> GpuProcessTransportFactory::CreateOutputSurface(
diff --git a/content/browser/dom_storage/dom_storage_database.cc b/content/browser/dom_storage/dom_storage_database.cc
index 155f1c6..aaf6bb0 100644
--- a/content/browser/dom_storage/dom_storage_database.cc
+++ b/content/browser/dom_storage/dom_storage_database.cc
@@ -229,8 +229,6 @@ DOMStorageDatabase::SchemaVersion DOMStorageDatabase::DetectSchemaVersion() {
default:
return INVALID;
}
- NOTREACHED();
- return INVALID;
}
bool DOMStorageDatabase::CreateTableV2() {
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index fa95b17..89637ea 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -194,29 +194,18 @@ bool IsThreadedCompositingEnabled() {
// Command line switches take precedence over blacklist.
if (command_line.HasSwitch(switches::kDisableForceCompositingMode) ||
- command_line.HasSwitch(switches::kDisableThreadedCompositing)) {
+ command_line.HasSwitch(switches::kDisableThreadedCompositing))
return false;
- } else if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) {
+ if (command_line.HasSwitch(switches::kEnableThreadedCompositing))
return true;
- }
#if defined(USE_AURA) || defined(OS_MACOSX)
// We always want threaded compositing on Aura and Mac (the fallback is a
// threaded software compositor).
return true;
-#endif
-
- if (!CanDoAcceleratedCompositing() || IsForceCompositingModeBlacklisted())
- return false;
-
-#if defined(OS_WIN)
- // Windows Vista+ has been shipping with TCM enabled at 100% since M24 and
- // The blacklist check above takes care of returning false before this hits
- // on unsupported Win versions.
- return true;
-#endif
-
+#else
return false;
+#endif
}
bool IsForceCompositingModeEnabled() {
@@ -229,7 +218,7 @@ bool IsForceCompositingModeEnabled() {
// Command line switches take precedence over blacklisting.
if (command_line.HasSwitch(switches::kDisableForceCompositingMode))
return false;
- else if (command_line.HasSwitch(switches::kForceCompositingMode))
+ if (command_line.HasSwitch(switches::kForceCompositingMode))
return true;
if (!CanDoAcceleratedCompositing() || IsForceCompositingModeBlacklisted())
@@ -240,9 +229,9 @@ bool IsForceCompositingModeEnabled() {
// Mac OSX 10.8+ since M28. The blacklist check above takes care of returning
// false before this hits on unsupported Win/Mac versions.
return true;
-#endif
-
+#else
return false;
+#endif
}
bool IsDelegatedRendererEnabled() {
diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding.cc b/content/browser/indexed_db/indexed_db_leveldb_coding.cc
index 694bf6e..4455683 100644
--- a/content/browser/indexed_db/indexed_db_leveldb_coding.cc
+++ b/content/browser/indexed_db/indexed_db_leveldb_coding.cc
@@ -310,14 +310,6 @@ void EncodeIDBKey(const IndexedDBKey& value, std::string* into) {
size_t previous_size = into->size();
DCHECK(value.IsValid());
switch (value.type()) {
- case WebIDBKeyTypeNull:
- case WebIDBKeyTypeInvalid:
- case WebIDBKeyTypeMin:
- default: {
- NOTREACHED();
- EncodeByte(kIndexedDBKeyNullTypeByte, into);
- return;
- }
case WebIDBKeyTypeArray: {
EncodeByte(kIndexedDBKeyArrayTypeByte, into);
size_t length = value.array().size();
@@ -327,33 +319,34 @@ void EncodeIDBKey(const IndexedDBKey& value, std::string* into) {
DCHECK_GT(into->size(), previous_size);
return;
}
- case WebIDBKeyTypeBinary: {
+ case WebIDBKeyTypeBinary:
EncodeByte(kIndexedDBKeyBinaryTypeByte, into);
EncodeBinary(value.binary(), into);
DCHECK_GT(into->size(), previous_size);
return;
- }
- case WebIDBKeyTypeString: {
+ case WebIDBKeyTypeString:
EncodeByte(kIndexedDBKeyStringTypeByte, into);
EncodeStringWithLength(value.string(), into);
DCHECK_GT(into->size(), previous_size);
return;
- }
- case WebIDBKeyTypeDate: {
+ case WebIDBKeyTypeDate:
EncodeByte(kIndexedDBKeyDateTypeByte, into);
EncodeDouble(value.date(), into);
DCHECK_EQ(9u, static_cast<size_t>(into->size() - previous_size));
return;
- }
- case WebIDBKeyTypeNumber: {
+ case WebIDBKeyTypeNumber:
EncodeByte(kIndexedDBKeyNumberTypeByte, into);
EncodeDouble(value.number(), into);
DCHECK_EQ(9u, static_cast<size_t>(into->size() - previous_size));
return;
- }
+ case WebIDBKeyTypeNull:
+ case WebIDBKeyTypeInvalid:
+ case WebIDBKeyTypeMin:
+ default:
+ NOTREACHED();
+ EncodeByte(kIndexedDBKeyNullTypeByte, into);
+ return;
}
-
- NOTREACHED();
}
void EncodeIDBKeyPath(const IndexedDBKeyPath& value, std::string* into) {
diff --git a/content/browser/renderer_host/input/gesture_event_queue.cc b/content/browser/renderer_host/input/gesture_event_queue.cc
index 99c1349..c71e692 100644
--- a/content/browser/renderer_host/input/gesture_event_queue.cc
+++ b/content/browser/renderer_host/input/gesture_event_queue.cc
@@ -96,9 +96,6 @@ bool GestureEventQueue::ShouldForwardForBounceReduction(
}
return true;
}
-
- NOTREACHED();
- return false;
}
// NOTE: The filters are applied successively. This simplifies the change.
@@ -150,8 +147,6 @@ bool GestureEventQueue::ShouldForwardForTapSuppression(
default:
return true;
}
- NOTREACHED();
- return false;
}
bool GestureEventQueue::ShouldForwardForCoalescing(
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index cf97c798..43929cb 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1299,10 +1299,9 @@ bool RenderProcessHostImpl::FastShutdownIfPossible() {
void RenderProcessHostImpl::DumpHandles() {
#if defined(OS_WIN)
Send(new ChildProcessMsg_DumpHandles());
- return;
-#endif
-
+#else
NOTIMPLEMENTED();
+#endif
}
// This is a platform specific function for mapping a transport DIB given its id
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 6467e70..f6f772f 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -707,10 +707,9 @@ bool RenderWidgetHostViewAura::ShouldCreateResizeLock() {
// whiteout. Because this causes the content to be drawn at wrong sizes while
// resizing we compensate by blocking the UI thread in Compositor::Draw() by
// issuing a FinishAllRendering() if we are resizing.
-#if defined (OS_WIN)
+#if defined(OS_WIN)
return false;
-#endif
-
+#else
if (resize_lock_)
return false;
@@ -732,6 +731,7 @@ bool RenderWidgetHostViewAura::ShouldCreateResizeLock() {
return false;
return true;
+#endif
}
scoped_ptr<ResizeLock> RenderWidgetHostViewAura::CreateResizeLock(
diff --git a/content/child/child_thread.cc b/content/child/child_thread.cc
index 3ecdb58..6d2c334 100644
--- a/content/child/child_thread.cc
+++ b/content/child/child_thread.cc
@@ -487,10 +487,9 @@ void ChildThread::OnDumpHandles() {
switches::kAuditAllHandles)));
handle_enum->EnumerateHandles();
Send(new ChildProcessHostMsg_DumpHandlesDone);
- return;
-#endif
-
+#else
NOTIMPLEMENTED();
+#endif
}
#if defined(USE_TCMALLOC)
@@ -522,7 +521,6 @@ void ChildThread::ShutdownThread() {
g_child_thread->message_loop()->PostTask(
FROM_HERE, base::Bind(&QuitMainThreadMessageLoop));
}
-
#endif
void ChildThread::OnProcessFinalRelease() {
diff --git a/content/child/indexed_db/indexed_db_key_builders.cc b/content/child/indexed_db/indexed_db_key_builders.cc
index ed84ac4..831161c 100644
--- a/content/child/indexed_db/indexed_db_key_builders.cc
+++ b/content/child/indexed_db/indexed_db_key_builders.cc
@@ -62,8 +62,6 @@ IndexedDBKey IndexedDBKeyBuilder::Build(const blink::WebIDBKey& key) {
NOTREACHED();
return IndexedDBKey();
}
- NOTREACHED();
- return IndexedDBKey();
}
WebIDBKey WebIDBKeyBuilder::Build(const IndexedDBKey& key) {
@@ -93,8 +91,6 @@ WebIDBKey WebIDBKeyBuilder::Build(const IndexedDBKey& key) {
NOTREACHED();
return WebIDBKey::createInvalid();
}
- NOTREACHED();
- return WebIDBKey::createInvalid();
}
IndexedDBKeyRange IndexedDBKeyRangeBuilder::Build(
@@ -115,9 +111,10 @@ IndexedDBKeyPath IndexedDBKeyPathBuilder::Build(
return IndexedDBKeyPath(CopyArray(key_path.array()));
case blink::WebIDBKeyPathTypeNull:
return IndexedDBKeyPath();
+ default:
+ NOTREACHED();
+ return IndexedDBKeyPath();
}
- NOTREACHED();
- return IndexedDBKeyPath();
}
blink::WebIDBKeyPath WebIDBKeyPathBuilder::Build(
@@ -129,9 +126,10 @@ blink::WebIDBKeyPath WebIDBKeyPathBuilder::Build(
return blink::WebIDBKeyPath::create(CopyArray(key_path.array()));
case blink::WebIDBKeyPathTypeNull:
return blink::WebIDBKeyPath::createNull();
+ default:
+ NOTREACHED();
+ return blink::WebIDBKeyPath::createNull();
}
- NOTREACHED();
- return blink::WebIDBKeyPath::createNull();
}
} // namespace content
diff --git a/content/child/npapi/webplugin_delegate_impl.cc b/content/child/npapi/webplugin_delegate_impl.cc
index 47456e1..c904278 100644
--- a/content/child/npapi/webplugin_delegate_impl.cc
+++ b/content/child/npapi/webplugin_delegate_impl.cc
@@ -287,7 +287,6 @@ bool WebPluginDelegateImpl::IsUserGesture(const WebInputEvent& event) {
default:
return false;
}
- return false;
}
WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient(
diff --git a/content/child/webcrypto/jwk.cc b/content/child/webcrypto/jwk.cc
index a540c02..ec653da 100644
--- a/content/child/webcrypto/jwk.cc
+++ b/content/child/webcrypto/jwk.cc
@@ -702,7 +702,8 @@ Status ImportKeyJwk(const CryptoData& key_data,
extractable,
usage_mask,
key);
- } else if (jwk_kty_value == "RSA") {
+ }
+ if (jwk_kty_value == "RSA") {
// An RSA public key must have an "n" (modulus) and an "e" (exponent) entry
// in the JWK, while an RSA private key must have those, plus at least a "d"
// (private exponent) entry.
@@ -731,11 +732,9 @@ Status ImportKeyJwk(const CryptoData& key_data,
CryptoData(jwk_e_value),
key);
- } else {
- return Status::ErrorJwkUnrecognizedKty();
}
- return Status::Success();
+ return Status::ErrorJwkUnrecognizedKty();
}
Status ExportKeyJwk(const blink::WebCryptoKey& key,
diff --git a/content/common/content_paths.cc b/content/common/content_paths.cc
index acea89a..ee59fe1 100644
--- a/content/common/content_paths.cc
+++ b/content/common/content_paths.cc
@@ -40,8 +40,6 @@ bool PathProvider(int key, base::FilePath* result) {
default:
return false;
}
-
- return false;
}
// This cannot be done as a static initializer sadly since Visual Studio will
diff --git a/content/common/content_switches_internal.cc b/content/common/content_switches_internal.cc
index 6f2a753..2f0638f 100644
--- a/content/common/content_switches_internal.cc
+++ b/content/common/content_switches_internal.cc
@@ -24,10 +24,10 @@ bool IsPinchToZoomEnabled() {
return base::win::GetVersion() >= base::win::VERSION_WIN8;
#elif defined(OS_CHROMEOS)
return true;
-#endif
-
+#else
return command_line.HasSwitch(switches::kEnableViewport) ||
command_line.HasSwitch(switches::kEnablePinch);
+#endif
}
} // namespace content
diff --git a/content/common/indexed_db/indexed_db_key.cc b/content/common/indexed_db/indexed_db_key.cc
index 3c51140..d80e5b6 100644
--- a/content/common/indexed_db/indexed_db_key.cc
+++ b/content/common/indexed_db/indexed_db_key.cc
@@ -139,8 +139,6 @@ int IndexedDBKey::Compare(const IndexedDBKey& other) const {
NOTREACHED();
return 0;
}
- NOTREACHED();
- return 0;
}
bool IndexedDBKey::IsLessThan(const IndexedDBKey& other) const {
diff --git a/content/common/indexed_db/indexed_db_param_traits.cc b/content/common/indexed_db/indexed_db_param_traits.cc
index 0a566e2..916503c 100644
--- a/content/common/indexed_db/indexed_db_param_traits.cc
+++ b/content/common/indexed_db/indexed_db_param_traits.cc
@@ -105,8 +105,6 @@ bool ParamTraits<IndexedDBKey>::Read(const Message* m,
NOTREACHED();
return false;
}
- NOTREACHED();
- return false;
}
void ParamTraits<IndexedDBKey>::Log(const param_type& p, std::string* l) {
@@ -143,8 +141,10 @@ void ParamTraits<IndexedDBKeyPath>::Write(Message* m, const param_type& p) {
return;
case WebIDBKeyPathTypeNull:
return;
+ default:
+ NOTREACHED();
+ return;
}
- NOTREACHED();
}
bool ParamTraits<IndexedDBKeyPath>::Read(const Message* m,
@@ -172,9 +172,10 @@ bool ParamTraits<IndexedDBKeyPath>::Read(const Message* m,
case WebIDBKeyPathTypeNull:
*r = IndexedDBKeyPath();
return true;
+ default:
+ NOTREACHED();
+ return false;
}
- NOTREACHED();
- return false;
}
void ParamTraits<IndexedDBKeyPath>::Log(const param_type& p, std::string* l) {
diff --git a/content/common/page_state_serialization_unittest.cc b/content/common/page_state_serialization_unittest.cc
index 2b5a181..c401878 100644
--- a/content/common/page_state_serialization_unittest.cc
+++ b/content/common/page_state_serialization_unittest.cc
@@ -358,11 +358,9 @@ TEST_F(PageStateSerializationTest, BadMessagesTest2) {
}
TEST_F(PageStateSerializationTest, DumpExpectedPageStateForBackwardsCompat) {
- // Comment out this return statement to enable this code. Use this code to
- // generate data, based on the current serialization format, for the
- // BackwardsCompat_vXX tests.
- return;
-
+ // Change to #if 1 to enable this code. Use this code to generate data, based
+ // on the current serialization format, for the BackwardsCompat_vXX tests.
+#if 0
ExplodedPageState state;
PopulatePageStateForBackwardsCompatTest(&state);
@@ -388,6 +386,7 @@ TEST_F(PageStateSerializationTest, DumpExpectedPageStateForBackwardsCompat) {
}
fclose(fp);
+#endif
}
#if !defined(OS_ANDROID)
diff --git a/content/renderer/media/webrtc_audio_device_impl.cc b/content/renderer/media/webrtc_audio_device_impl.cc
index 48dbdc6..e1aea4d 100644
--- a/content/renderer/media/webrtc_audio_device_impl.cc
+++ b/content/renderer/media/webrtc_audio_device_impl.cc
@@ -462,12 +462,7 @@ WebRtcAudioDeviceImpl::GetDefaultCapturer() const {
base::AutoLock auto_lock(lock_);
// Use the last |capturer| which is from the latest getUserMedia call as
// the default capture device.
- for (CapturerList::const_reverse_iterator iter = capturers_.rbegin();
- iter != capturers_.rend(); ++iter) {
- return *iter;
- }
-
- return NULL;
+ return capturers_.empty() ? NULL : capturers_.back();
}
void WebRtcAudioDeviceImpl::AddPlayoutSink(
diff --git a/content/shell/renderer/test_runner/TestPlugin.cpp b/content/shell/renderer/test_runner/TestPlugin.cpp
index bf5d244..7293cb4 100644
--- a/content/shell/renderer/test_runner/TestPlugin.cpp
+++ b/content/shell/renderer/test_runner/TestPlugin.cpp
@@ -83,9 +83,6 @@ const char* pointState(WebTouchPoint::State state)
default:
return "Unknown";
}
-
- BLINK_ASSERT_NOT_REACHED();
- return 0;
}
void printTouchList(WebTestDelegate* delegate, const WebTouchPoint* points, int length)
diff --git a/content/test/mock_webclipboard_impl.cc b/content/test/mock_webclipboard_impl.cc
index a9c2c65..dfd22ba 100644
--- a/content/test/mock_webclipboard_impl.cc
+++ b/content/test/mock_webclipboard_impl.cc
@@ -45,20 +45,6 @@ bool MockWebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) {
NOTREACHED();
return false;
}
-
- switch (buffer) {
- case BufferStandard:
- break;
- case BufferSelection:
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
- break;
-#endif
- default:
- NOTREACHED();
- return false;
- }
-
- return true;
}
WebVector<WebString> MockWebClipboardImpl::readAvailableTypes(