summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormostynb <mostynb@opera.com>2015-03-18 14:47:47 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-18 21:48:38 +0000
commit4c27d0473be08853f38b5031c660bfb3ae6158d4 (patch)
tree3604c8f40872045f13a6c4b0f8359eb8ad01df05
parent4126b1aa1147de024f9e982cdca7023be0655d86 (diff)
downloadchromium_src-4c27d0473be08853f38b5031c660bfb3ae6158d4.zip
chromium_src-4c27d0473be08853f38b5031c660bfb3ae6158d4.tar.gz
chromium_src-4c27d0473be08853f38b5031c660bfb3ae6158d4.tar.bz2
favor DCHECK_CURRENTLY_ON for better logs in content/browser/[f-p]*
BUG=466848 Review URL: https://codereview.chromium.org/1000373002 Cr-Commit-Position: refs/heads/master@{#321215}
-rw-r--r--content/browser/fileapi/chrome_blob_storage_context.cc6
-rw-r--r--content/browser/fileapi/file_system_browsertest.cc2
-rw-r--r--content/browser/fileapi/fileapi_message_filter.cc68
-rw-r--r--content/browser/frame_host/cross_site_transferring_request.cc2
-rw-r--r--content/browser/frame_host/interstitial_page_impl.cc3
-rw-r--r--content/browser/frame_host/render_frame_host_impl.cc2
-rw-r--r--content/browser/frame_host/render_frame_message_filter.cc2
-rw-r--r--content/browser/frame_host/render_frame_proxy_host.cc2
-rw-r--r--content/browser/geolocation/geolocation_provider_impl.cc14
-rw-r--r--content/browser/gpu/browser_gpu_channel_host_factory.cc8
-rw-r--r--content/browser/gpu/browser_gpu_memory_buffer_manager.cc10
-rw-r--r--content/browser/gpu/gpu_internals_ui.cc8
-rw-r--r--content/browser/gpu/gpu_process_host.cc4
-rw-r--r--content/browser/gpu/gpu_process_host_ui_shim.cc8
-rw-r--r--content/browser/gpu/shader_disk_cache.cc10
-rw-r--r--content/browser/histogram_controller.cc10
-rw-r--r--content/browser/histogram_synchronizer.cc22
-rw-r--r--content/browser/host_zoom_map_impl.cc16
-rw-r--r--content/browser/indexed_db/indexed_db_browsertest.cc2
-rw-r--r--content/browser/indexed_db/indexed_db_callbacks.cc4
-rw-r--r--content/browser/indexed_db/indexed_db_context_impl.cc4
-rw-r--r--content/browser/indexed_db/indexed_db_dispatcher_host.cc6
-rw-r--r--content/browser/indexed_db/indexed_db_internals_ui.cc10
-rw-r--r--content/browser/indexed_db/indexed_db_quota_client.cc2
-rw-r--r--content/browser/loader/resource_dispatcher_host_impl.cc16
-rw-r--r--content/browser/loader/resource_loader.cc4
-rw-r--r--content/browser/loader/temporary_file_stream.cc4
-rw-r--r--content/browser/media/android/media_resource_getter_impl.cc26
-rw-r--r--content/browser/media/capture/content_video_capture_device_core.cc2
-rw-r--r--content/browser/media/capture/desktop_capture_device_aura.cc2
-rw-r--r--content/browser/media/media_internals.cc20
-rw-r--r--content/browser/media/media_internals_handler.cc2
-rw-r--r--content/browser/media/media_internals_proxy.cc24
-rw-r--r--content/browser/media/webrtc_identity_store.cc24
-rw-r--r--content/browser/media/webrtc_identity_store_backend.cc28
-rw-r--r--content/browser/media/webrtc_internals.cc22
-rw-r--r--content/browser/media/webrtc_internals_message_handler.cc2
-rw-r--r--content/browser/pepper_flash_settings_helper_impl.cc4
-rw-r--r--content/browser/plugin_data_remover_impl.cc8
-rw-r--r--content/browser/plugin_loader_posix.cc6
-rw-r--r--content/browser/plugin_process_host.cc4
-rw-r--r--content/browser/plugin_process_host_mac.cc2
-rw-r--r--content/browser/plugin_service_impl.cc20
-rw-r--r--content/browser/plugin_service_impl_browsertest.cc8
-rw-r--r--content/browser/power_profiler/power_profiler_service.cc4
-rw-r--r--content/browser/power_save_blocker_android.cc4
-rw-r--r--content/browser/power_save_blocker_chromeos.cc4
-rw-r--r--content/browser/power_save_blocker_win.cc4
-rw-r--r--content/browser/power_save_blocker_x11.cc6
-rw-r--r--content/browser/profiler_controller_impl.cc10
-rw-r--r--content/browser/push_messaging/push_messaging_router.cc8
51 files changed, 246 insertions, 247 deletions
diff --git a/content/browser/fileapi/chrome_blob_storage_context.cc b/content/browser/fileapi/chrome_blob_storage_context.cc
index 1f8acc8..5e2c4c8 100644
--- a/content/browser/fileapi/chrome_blob_storage_context.cc
+++ b/content/browser/fileapi/chrome_blob_storage_context.cc
@@ -60,13 +60,13 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
}
void ChromeBlobStorageContext::InitializeOnIOThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
context_.reset(new BlobStorageContext());
}
scoped_ptr<BlobHandle> ChromeBlobStorageContext::CreateMemoryBackedBlob(
const char* data, size_t length) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
std::string uuid(base::GenerateGUID());
storage::BlobDataBuilder blob_data_builder(uuid);
@@ -87,7 +87,7 @@ scoped_ptr<BlobHandle> ChromeBlobStorageContext::CreateFileBackedBlob(
int64_t offset,
int64_t size,
const base::Time& expected_modification_time) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
std::string uuid(base::GenerateGUID());
storage::BlobDataBuilder blob_data_builder(uuid);
diff --git a/content/browser/fileapi/file_system_browsertest.cc b/content/browser/fileapi/file_system_browsertest.cc
index 804f04e..79e9f3cb 100644
--- a/content/browser/fileapi/file_system_browsertest.cc
+++ b/content/browser/fileapi/file_system_browsertest.cc
@@ -69,7 +69,7 @@ class FileSystemBrowserTestWithLowQuota : public FileSystemBrowserTest {
qm));
return;
}
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
qm->SetTemporaryGlobalOverrideQuota(bytes, storage::QuotaCallback());
// Don't return until the quota has been set.
scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper(
diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc
index b4ef0ce..ca67e18 100644
--- a/content/browser/fileapi/fileapi_message_filter.cc
+++ b/content/browser/fileapi/fileapi_message_filter.cc
@@ -106,7 +106,7 @@ FileAPIMessageFilter::FileAPIMessageFilter(
}
void FileAPIMessageFilter::OnChannelConnected(int32 peer_pid) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (request_context_getter_.get()) {
DCHECK(!request_context_);
@@ -122,7 +122,7 @@ void FileAPIMessageFilter::OnChannelConnected(int32 peer_pid) {
}
void FileAPIMessageFilter::OnChannelClosing() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Unregister all the blob and stream URLs that are previously registered in
// this process.
@@ -206,7 +206,7 @@ void FileAPIMessageFilter::BadMessageReceived() {
void FileAPIMessageFilter::OnOpenFileSystem(int request_id,
const GURL& origin_url,
storage::FileSystemType type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (type == storage::kFileSystemTypeTemporary) {
RecordAction(base::UserMetricsAction("OpenFileSystemTemporary"));
} else if (type == storage::kFileSystemTypePersistent) {
@@ -221,7 +221,7 @@ void FileAPIMessageFilter::OnOpenFileSystem(int request_id,
void FileAPIMessageFilter::OnResolveURL(
int request_id,
const GURL& filesystem_url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL url(context_->CrackURL(filesystem_url));
if (!ValidateFileSystemURL(request_id, url))
return;
@@ -238,14 +238,14 @@ void FileAPIMessageFilter::OnResolveURL(
void FileAPIMessageFilter::OnDeleteFileSystem(int request_id,
const GURL& origin_url,
storage::FileSystemType type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
context_->DeleteFileSystem(origin_url, type, base::Bind(
&FileAPIMessageFilter::DidDeleteFileSystem, this, request_id));
}
void FileAPIMessageFilter::OnMove(
int request_id, const GURL& src_path, const GURL& dest_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL src_url(context_->CrackURL(src_path));
FileSystemURL dest_url(context_->CrackURL(dest_path));
if (!ValidateFileSystemURL(request_id, src_url) ||
@@ -269,7 +269,7 @@ void FileAPIMessageFilter::OnMove(
void FileAPIMessageFilter::OnCopy(
int request_id, const GURL& src_path, const GURL& dest_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL src_url(context_->CrackURL(src_path));
FileSystemURL dest_url(context_->CrackURL(dest_path));
if (!ValidateFileSystemURL(request_id, src_url) ||
@@ -293,7 +293,7 @@ void FileAPIMessageFilter::OnCopy(
void FileAPIMessageFilter::OnRemove(
int request_id, const GURL& path, bool recursive) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL url(context_->CrackURL(path));
if (!ValidateFileSystemURL(request_id, url))
return;
@@ -310,7 +310,7 @@ void FileAPIMessageFilter::OnRemove(
void FileAPIMessageFilter::OnReadMetadata(
int request_id, const GURL& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL url(context_->CrackURL(path));
if (!ValidateFileSystemURL(request_id, url))
return;
@@ -327,7 +327,7 @@ void FileAPIMessageFilter::OnReadMetadata(
void FileAPIMessageFilter::OnCreate(
int request_id, const GURL& path, bool exclusive,
bool is_directory, bool recursive) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL url(context_->CrackURL(path));
if (!ValidateFileSystemURL(request_id, url))
return;
@@ -350,7 +350,7 @@ void FileAPIMessageFilter::OnCreate(
void FileAPIMessageFilter::OnExists(
int request_id, const GURL& path, bool is_directory) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL url(context_->CrackURL(path));
if (!ValidateFileSystemURL(request_id, url))
return;
@@ -373,7 +373,7 @@ void FileAPIMessageFilter::OnExists(
void FileAPIMessageFilter::OnReadDirectory(
int request_id, const GURL& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL url(context_->CrackURL(path));
if (!ValidateFileSystemURL(request_id, url))
return;
@@ -393,7 +393,7 @@ void FileAPIMessageFilter::OnWrite(
const GURL& path,
const std::string& blob_uuid,
int64 offset) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!request_context_) {
// We can't write w/o a request context, trying to do so will crash.
NOTREACHED();
@@ -440,7 +440,7 @@ void FileAPIMessageFilter::OnTouchFile(
const GURL& path,
const base::Time& last_access_time,
const base::Time& last_modified_time) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL url(context_->CrackURL(path));
if (!ValidateFileSystemURL(request_id, url))
return;
@@ -458,7 +458,7 @@ void FileAPIMessageFilter::OnTouchFile(
void FileAPIMessageFilter::OnCancel(
int request_id,
int request_id_to_cancel) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
OperationsMap::iterator found = operations_.find(request_id_to_cancel);
if (found != operations_.end()) {
@@ -481,7 +481,7 @@ void FileAPIMessageFilter::OnSyncGetPlatformPath(
void FileAPIMessageFilter::OnCreateSnapshotFile(
int request_id, const GURL& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL url(context_->CrackURL(path));
// Make sure if this file can be read by the renderer as this is
@@ -510,19 +510,19 @@ void FileAPIMessageFilter::OnCreateSnapshotFile(
}
void FileAPIMessageFilter::OnDidReceiveSnapshotFile(int request_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
in_transit_snapshot_files_.erase(request_id);
}
void FileAPIMessageFilter::OnStartBuildingBlob(const std::string& uuid) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ignore_result(blob_storage_host_->StartBuildingBlob(uuid));
}
void FileAPIMessageFilter::OnAppendBlobDataItemToBlob(
const std::string& uuid,
const storage::DataElement& item) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (item.type() == storage::DataElement::TYPE_FILE_FILESYSTEM) {
FileSystemURL filesystem_url(context_->CrackURL(item.filesystem_url()));
if (!FileSystemURLIsValid(context_, filesystem_url) ||
@@ -570,35 +570,35 @@ void FileAPIMessageFilter::OnAppendSharedMemoryToBlob(
void FileAPIMessageFilter::OnFinishBuildingBlob(
const std::string& uuid, const std::string& content_type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ignore_result(blob_storage_host_->FinishBuildingBlob(uuid, content_type));
// TODO(michaeln): check return values once blink has migrated, crbug/174200
}
void FileAPIMessageFilter::OnIncrementBlobRefCount(const std::string& uuid) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ignore_result(blob_storage_host_->IncrementBlobRefCount(uuid));
}
void FileAPIMessageFilter::OnDecrementBlobRefCount(const std::string& uuid) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ignore_result(blob_storage_host_->DecrementBlobRefCount(uuid));
}
void FileAPIMessageFilter::OnRegisterPublicBlobURL(
const GURL& public_url, const std::string& uuid) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ignore_result(blob_storage_host_->RegisterPublicBlobURL(public_url, uuid));
}
void FileAPIMessageFilter::OnRevokePublicBlobURL(const GURL& public_url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ignore_result(blob_storage_host_->RevokePublicBlobURL(public_url));
}
void FileAPIMessageFilter::OnStartBuildingStream(
const GURL& url, const std::string& content_type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Only an internal Blob URL is expected here. See the BlobURL of the Blink.
if (!StartsWithASCII(
url.path(), "blobinternal%3A///", true /* case_sensitive */)) {
@@ -617,7 +617,7 @@ void FileAPIMessageFilter::OnStartBuildingStream(
void FileAPIMessageFilter::OnAppendBlobDataItemToStream(
const GURL& url,
const storage::DataElement& item) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
scoped_refptr<Stream> stream(GetStreamForURL(url));
// Stream instances may be deleted on error. Just abort if there's no Stream
@@ -658,21 +658,21 @@ void FileAPIMessageFilter::OnAppendSharedMemoryToStream(
}
void FileAPIMessageFilter::OnFlushStream(const GURL& url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
scoped_refptr<Stream> stream(GetStreamForURL(url));
if (stream.get())
stream->Flush();
}
void FileAPIMessageFilter::OnFinishBuildingStream(const GURL& url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
scoped_refptr<Stream> stream(GetStreamForURL(url));
if (stream.get())
stream->Finalize();
}
void FileAPIMessageFilter::OnAbortBuildingStream(const GURL& url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
scoped_refptr<Stream> stream(GetStreamForURL(url));
if (stream.get())
stream->Abort();
@@ -680,7 +680,7 @@ void FileAPIMessageFilter::OnAbortBuildingStream(const GURL& url) {
void FileAPIMessageFilter::OnCloneStream(
const GURL& url, const GURL& src_url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Abort if there's no Stream instance for |src_url| (source Stream which
// we're going to make |url| point to) in the registry.
if (!GetStreamForURL(src_url).get())
@@ -691,7 +691,7 @@ void FileAPIMessageFilter::OnCloneStream(
}
void FileAPIMessageFilter::OnRemoveStream(const GURL& url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!GetStreamForURL(url).get())
return;
@@ -769,7 +769,7 @@ void FileAPIMessageFilter::DidOpenFileSystem(int request_id,
const GURL& root,
const std::string& filesystem_name,
base::File::Error result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (result == base::File::FILE_OK) {
DCHECK(root.is_valid());
Send(new FileSystemMsg_DidOpenFileSystem(
@@ -786,7 +786,7 @@ void FileAPIMessageFilter::DidResolveURL(
const storage::FileSystemInfo& info,
const base::FilePath& file_path,
storage::FileSystemContext::ResolvedEntryType type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (result == base::File::FILE_OK &&
type == storage::FileSystemContext::RESOLVED_ENTRY_NOT_FOUND)
result = base::File::FILE_ERROR_NOT_FOUND;
@@ -822,7 +822,7 @@ void FileAPIMessageFilter::DidCreateSnapshot(
const base::File::Info& info,
const base::FilePath& platform_path,
const scoped_refptr<storage::ShareableFileReference>& /* unused */) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
operations_.erase(request_id);
if (result != base::File::FILE_OK) {
diff --git a/content/browser/frame_host/cross_site_transferring_request.cc b/content/browser/frame_host/cross_site_transferring_request.cc
index 6d3ac2c..1a34fe7 100644
--- a/content/browser/frame_host/cross_site_transferring_request.cc
+++ b/content/browser/frame_host/cross_site_transferring_request.cc
@@ -14,7 +14,7 @@ namespace content {
namespace {
void CancelRequestOnIOThread(GlobalRequestID global_request_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ResourceDispatcherHostImpl::Get()->CancelTransferringNavigation(
global_request_id);
diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc
index 1324c73..197d9d4 100644
--- a/content/browser/frame_host/interstitial_page_impl.cc
+++ b/content/browser/frame_host/interstitial_page_impl.cc
@@ -781,8 +781,7 @@ void InterstitialPageImpl::OnNavigatingAwayOrTabClosing() {
void InterstitialPageImpl::TakeActionOnResourceDispatcher(
ResourceRequestAction action) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)) <<
- "TakeActionOnResourceDispatcher should be called on the main thread.";
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (action == CANCEL || action == RESUME) {
if (resource_dispatcher_host_notified_)
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 8b1cfb2..f56fff2 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -123,7 +123,7 @@ RenderFrameHost* RenderFrameHost::FromID(int render_process_id,
// static
RenderFrameHostImpl* RenderFrameHostImpl::FromID(int process_id,
int routing_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
RoutingIDFrameMap* frames = g_routing_id_frame_map.Pointer();
RoutingIDFrameMap::iterator it = frames->find(
RenderFrameHostID(process_id, routing_id));
diff --git a/content/browser/frame_host/render_frame_message_filter.cc b/content/browser/frame_host/render_frame_message_filter.cc
index c729954..8fb9310 100644
--- a/content/browser/frame_host/render_frame_message_filter.cc
+++ b/content/browser/frame_host/render_frame_message_filter.cc
@@ -18,7 +18,7 @@ void CreateChildFrameOnUI(int process_id,
const std::string& frame_name,
SandboxFlags sandbox_flags,
int new_routing_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
RenderFrameHostImpl* render_frame_host =
RenderFrameHostImpl::FromID(process_id, parent_routing_id);
// Handles the RenderFrameHost being deleted on the UI thread while
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc
index 5b74b1e..988f9e8 100644
--- a/content/browser/frame_host/render_frame_proxy_host.cc
+++ b/content/browser/frame_host/render_frame_proxy_host.cc
@@ -33,7 +33,7 @@ base::LazyInstance<RoutingIDFrameProxyMap> g_routing_id_frame_proxy_map =
// static
RenderFrameProxyHost* RenderFrameProxyHost::FromID(int process_id,
int routing_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
RoutingIDFrameProxyMap* frames = g_routing_id_frame_proxy_map.Pointer();
RoutingIDFrameProxyMap::iterator it = frames->find(
RenderFrameProxyHostID(process_id, routing_id));
diff --git a/content/browser/geolocation/geolocation_provider_impl.cc b/content/browser/geolocation/geolocation_provider_impl.cc
index 626a52a..7375d57 100644
--- a/content/browser/geolocation/geolocation_provider_impl.cc
+++ b/content/browser/geolocation/geolocation_provider_impl.cc
@@ -23,7 +23,7 @@ GeolocationProvider* GeolocationProvider::GetInstance() {
scoped_ptr<GeolocationProvider::Subscription>
GeolocationProviderImpl::AddLocationUpdateCallback(
const LocationUpdateCallback& callback, bool use_high_accuracy) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_ptr<GeolocationProvider::Subscription> subscription;
if (use_high_accuracy) {
subscription = high_accuracy_callbacks_.Add(callback);
@@ -41,7 +41,7 @@ GeolocationProviderImpl::AddLocationUpdateCallback(
}
void GeolocationProviderImpl::UserDidOptIntoLocationServices() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
bool was_permission_granted = user_did_opt_into_location_services_;
user_did_opt_into_location_services_ = true;
if (IsRunning() && !was_permission_granted)
@@ -50,7 +50,7 @@ void GeolocationProviderImpl::UserDidOptIntoLocationServices() {
void GeolocationProviderImpl::OverrideLocationForTesting(
const Geoposition& position) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
ignore_location_updates_ = true;
NotifyClients(position);
}
@@ -67,7 +67,7 @@ void GeolocationProviderImpl::OnLocationUpdate(const Geoposition& position) {
}
GeolocationProviderImpl* GeolocationProviderImpl::GetInstance() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return Singleton<GeolocationProviderImpl>::get();
}
@@ -76,7 +76,7 @@ GeolocationProviderImpl::GeolocationProviderImpl()
user_did_opt_into_location_services_(false),
ignore_location_updates_(false),
arbitrator_(NULL) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
high_accuracy_callbacks_.set_removal_callback(
base::Bind(&GeolocationProviderImpl::OnClientsChanged,
base::Unretained(this)));
@@ -95,7 +95,7 @@ bool GeolocationProviderImpl::OnGeolocationThread() const {
}
void GeolocationProviderImpl::OnClientsChanged() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::Closure task;
if (high_accuracy_callbacks_.empty() && low_accuracy_callbacks_.empty()) {
DCHECK(IsRunning());
@@ -151,7 +151,7 @@ void GeolocationProviderImpl::InformProvidersPermissionGranted() {
}
void GeolocationProviderImpl::NotifyClients(const Geoposition& position) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(position.Validate() ||
position.error_code != Geoposition::ERROR_CODE_NONE);
position_ = position;
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index d938b4b..16ce758 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -452,7 +452,7 @@ void BrowserGpuChannelHostFactory::GpuChannelEstablished() {
void BrowserGpuChannelHostFactory::AddFilterOnIO(
int host_id,
scoped_refptr<IPC::MessageFilter> filter) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
GpuProcessHost* host = GpuProcessHost::FromID(host_id);
if (host)
@@ -503,7 +503,7 @@ void BrowserGpuChannelHostFactory::CreateGpuMemoryBuffer(
int client_id,
int32 surface_id,
const CreateGpuMemoryBufferCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
if (!host) {
@@ -538,7 +538,7 @@ void BrowserGpuChannelHostFactory::DestroyGpuMemoryBufferOnIO(
gfx::GpuMemoryBufferId id,
int client_id,
int32 sync_point) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
if (!host)
@@ -550,7 +550,7 @@ void BrowserGpuChannelHostFactory::DestroyGpuMemoryBufferOnIO(
void BrowserGpuChannelHostFactory::OnGpuMemoryBufferCreated(
uint32 request_id,
const gfx::GpuMemoryBufferHandle& handle) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
CreateGpuMemoryBufferCallbackMap::iterator iter =
create_gpu_memory_buffer_requests_.find(request_id);
diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
index b628d43..59b2ed7 100644
--- a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
+++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
@@ -126,7 +126,7 @@ void BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferForChildProcess(
base::ProcessHandle child_process_handle,
int child_client_id,
const AllocationCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
gfx::GpuMemoryBufferId new_id = g_next_gpu_memory_buffer_id.GetNext();
@@ -182,7 +182,7 @@ void BrowserGpuMemoryBufferManager::ChildProcessDeletedGpuMemoryBuffer(
base::ProcessHandle child_process_handle,
int child_client_id,
uint32 sync_point) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(clients_.find(child_client_id) != clients_.end());
BufferMap& buffers = clients_[child_client_id];
@@ -214,7 +214,7 @@ void BrowserGpuMemoryBufferManager::ChildProcessDeletedGpuMemoryBuffer(
void BrowserGpuMemoryBufferManager::ProcessRemoved(
base::ProcessHandle process_handle,
int client_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ClientMap::iterator client_it = clients_.find(client_id);
if (client_it == clients_.end())
@@ -253,7 +253,7 @@ void BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferOnIO(
void BrowserGpuMemoryBufferManager::GpuMemoryBufferAllocatedOnIO(
AllocateGpuMemoryBufferRequest* request,
const gfx::GpuMemoryBufferHandle& handle) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Early out if factory failed to allocate the buffer.
if (handle.is_null()) {
@@ -286,7 +286,7 @@ void BrowserGpuMemoryBufferManager::GpuMemoryBufferAllocatedForChildProcess(
int child_client_id,
const AllocationCallback& callback,
const gfx::GpuMemoryBufferHandle& handle) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ClientMap::iterator client_it = clients_.find(child_client_id);
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc
index 32bda83..3a013df 100644
--- a/content/browser/gpu/gpu_internals_ui.cc
+++ b/content/browser/gpu/gpu_internals_ui.cc
@@ -276,7 +276,7 @@ GpuMessageHandler::~GpuMessageHandler() {
/* BrowserBridge.callAsync prepends a requestID to these messages. */
void GpuMessageHandler::RegisterMessages() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
web_ui()->RegisterMessageCallback("browserBridgeInitialized",
base::Bind(&GpuMessageHandler::OnBrowserBridgeInitialized,
@@ -335,7 +335,7 @@ void GpuMessageHandler::OnCallAsync(const base::ListValue* args) {
void GpuMessageHandler::OnBrowserBridgeInitialized(
const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Watch for changes in GPUInfo
if (!observing_) {
@@ -355,7 +355,7 @@ void GpuMessageHandler::OnBrowserBridgeInitialized(
base::Value* GpuMessageHandler::OnRequestClientInfo(
const base::ListValue* list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::DictionaryValue* dict = new base::DictionaryValue();
@@ -376,7 +376,7 @@ base::Value* GpuMessageHandler::OnRequestClientInfo(
}
base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return GpuDataManagerImpl::GetInstance()->GetLogMessages();
}
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index f0dbf33..98a6f2a 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -286,7 +286,7 @@ bool GpuProcessHost::ValidateHost(GpuProcessHost* host) {
// static
GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind,
CauseForGpuLaunch cause) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Don't grant further access to GPU if it is not allowed.
GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
@@ -360,7 +360,7 @@ void GpuProcessHost::RegisterGpuMainThreadFactory(
// static
GpuProcessHost* GpuProcessHost::FromID(int host_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
for (int i = 0; i < GPU_PROCESS_KIND_COUNT; ++i) {
GpuProcessHost* host = g_gpu_process_hosts[i];
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index abc5398..bafd049 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -128,7 +128,7 @@ GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) {
// static
void GpuProcessHostUIShim::Destroy(int host_id, const std::string& message) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
GpuDataManagerImpl::GetInstance()->AddLogMessage(
logging::LOG_ERROR, "GpuProcessHostUIShim",
@@ -145,7 +145,7 @@ void GpuProcessHostUIShim::Destroy(int host_id, const std::string& message) {
// static
void GpuProcessHostUIShim::DestroyAll() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
while (!g_hosts_by_id.Pointer()->IsEmpty()) {
IDMap<GpuProcessHostUIShim>::iterator it(g_hosts_by_id.Pointer());
delete it.GetCurrentValue();
@@ -154,13 +154,13 @@ void GpuProcessHostUIShim::DestroyAll() {
// static
GpuProcessHostUIShim* GpuProcessHostUIShim::FromID(int host_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return g_hosts_by_id.Pointer()->Lookup(host_id);
}
// static
GpuProcessHostUIShim* GpuProcessHostUIShim::GetOneInstance() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (g_hosts_by_id.Pointer()->IsEmpty())
return NULL;
IDMap<GpuProcessHostUIShim>::iterator it(g_hosts_by_id.Pointer());
diff --git a/content/browser/gpu/shader_disk_cache.cc b/content/browser/gpu/shader_disk_cache.cc
index 24f0703..64b167f 100644
--- a/content/browser/gpu/shader_disk_cache.cc
+++ b/content/browser/gpu/shader_disk_cache.cc
@@ -399,16 +399,16 @@ ShaderClearHelper::ShaderClearHelper(scoped_refptr<ShaderDiskCache> cache,
}
ShaderClearHelper::~ShaderClearHelper() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
}
void ShaderClearHelper::Clear() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DoClearShaderCache(net::OK);
}
void ShaderClearHelper::DoClearShaderCache(int rv) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Hold a ref to ourselves so when we do the CacheCleared call we don't get
// auto-deleted when our ref count drops to zero.
@@ -493,7 +493,7 @@ void ShaderCacheFactory::ClearByPath(const base::FilePath& path,
const base::Time& delete_begin,
const base::Time& delete_end,
const base::Closure& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(!callback.is_null());
scoped_refptr<ShaderClearHelper> helper = new ShaderClearHelper(
@@ -517,7 +517,7 @@ void ShaderCacheFactory::ClearByPath(const base::FilePath& path,
}
void ShaderCacheFactory::CacheCleared(const base::FilePath& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ShaderClearMap::iterator iter = shader_clear_map_.find(path);
if (iter == shader_clear_map_.end()) {
diff --git a/content/browser/histogram_controller.cc b/content/browser/histogram_controller.cc
index 3b11c32..563a495 100644
--- a/content/browser/histogram_controller.cc
+++ b/content/browser/histogram_controller.cc
@@ -30,7 +30,7 @@ HistogramController::~HistogramController() {
void HistogramController::OnPendingProcesses(int sequence_number,
int pending_processes,
bool end) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (subscriber_)
subscriber_->OnPendingProcesses(sequence_number, pending_processes, end);
}
@@ -48,7 +48,7 @@ void HistogramController::OnHistogramDataCollected(
return;
}
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (subscriber_) {
subscriber_->OnHistogramDataCollected(sequence_number,
pickled_histograms);
@@ -56,7 +56,7 @@ void HistogramController::OnHistogramDataCollected(
}
void HistogramController::Register(HistogramSubscriber* subscriber) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!subscriber_);
subscriber_ = subscriber;
}
@@ -69,7 +69,7 @@ void HistogramController::Unregister(
void HistogramController::GetHistogramDataFromChildProcesses(
int sequence_number) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
int pending_processes = 0;
for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) {
@@ -106,7 +106,7 @@ void HistogramController::GetHistogramDataFromChildProcesses(
}
void HistogramController::GetHistogramData(int sequence_number) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
int pending_processes = 0;
for (RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator());
diff --git a/content/browser/histogram_synchronizer.cc b/content/browser/histogram_synchronizer.cc
index 1661723..9b15b73 100644
--- a/content/browser/histogram_synchronizer.cc
+++ b/content/browser/histogram_synchronizer.cc
@@ -50,18 +50,18 @@ class HistogramSynchronizer::RequestContext {
~RequestContext() {}
void SetReceivedProcessGroupCount(bool done) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
received_process_group_count_ = done;
}
// Methods for book keeping of processes_pending_.
void AddProcessesPending(int processes_pending) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
processes_pending_ += processes_pending;
}
void DecrementProcessesPending() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
--processes_pending_;
}
@@ -70,7 +70,7 @@ class HistogramSynchronizer::RequestContext {
// |processes_pending_| are zero, then delete the current object by calling
// Unregister.
void DeleteIfAllDone() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (processes_pending_ <= 0 && received_process_group_count_)
RequestContext::Unregister(sequence_number_);
@@ -79,7 +79,7 @@ class HistogramSynchronizer::RequestContext {
// Register |callback| in |outstanding_requests_| map for the given
// |sequence_number|.
static void Register(const base::Closure& callback, int sequence_number) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestContext* request = new RequestContext(callback, sequence_number);
outstanding_requests_.Get()[sequence_number] = request;
@@ -88,7 +88,7 @@ class HistogramSynchronizer::RequestContext {
// Find the |RequestContext| in |outstanding_requests_| map for the given
// |sequence_number|.
static RequestContext* GetRequestContext(int sequence_number) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestContextMap::iterator it =
outstanding_requests_.Get().find(sequence_number);
@@ -104,7 +104,7 @@ class HistogramSynchronizer::RequestContext {
// |outstanding_requests_| map. This method is called when all changes have
// been acquired, or when the wait time expires (whichever is sooner).
static void Unregister(int sequence_number) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestContextMap::iterator it =
outstanding_requests_.Get().find(sequence_number);
@@ -190,7 +190,7 @@ void HistogramSynchronizer::FetchHistograms() {
base::Bind(&HistogramSynchronizer::FetchHistograms));
return;
}
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
HistogramSynchronizer* current_synchronizer =
HistogramSynchronizer::GetInstance();
@@ -229,7 +229,7 @@ void HistogramSynchronizer::FetchHistogramsAsynchronously(
void HistogramSynchronizer::RegisterAndNotifyAllProcesses(
ProcessHistogramRequester requester,
base::TimeDelta wait_time) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
int sequence_number = GetNextAvailableSequenceNumber(requester);
@@ -254,7 +254,7 @@ void HistogramSynchronizer::RegisterAndNotifyAllProcesses(
void HistogramSynchronizer::OnPendingProcesses(int sequence_number,
int pending_processes,
bool end) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestContext* request = RequestContext::GetRequestContext(sequence_number);
if (!request)
@@ -267,7 +267,7 @@ void HistogramSynchronizer::OnPendingProcesses(int sequence_number,
void HistogramSynchronizer::OnHistogramDataCollected(
int sequence_number,
const std::vector<std::string>& pickled_histograms) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::HistogramDeltaSerialization::DeserializeAndAddSamples(
pickled_histograms);
diff --git a/content/browser/host_zoom_map_impl.cc b/content/browser/host_zoom_map_impl.cc
index 2881a44..2c1c5ec 100644
--- a/content/browser/host_zoom_map_impl.cc
+++ b/content/browser/host_zoom_map_impl.cc
@@ -31,7 +31,7 @@ namespace content {
namespace {
std::string GetHostFromProcessView(int render_process_id, int render_view_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
RenderViewHost* render_view_host =
RenderViewHost::FromID(render_process_id, render_view_id);
if (!render_view_host)
@@ -125,7 +125,7 @@ void HostZoomMapImpl::CopyFrom(HostZoomMap* copy_interface) {
// UI: a.CopyFrom(b);
// IO: b.CopyFrom(a);
// can deadlock.
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
HostZoomMapImpl* copy = static_cast<HostZoomMapImpl*>(copy_interface);
base::AutoLock auto_lock(lock_);
base::AutoLock copy_auto_lock(copy->lock_);
@@ -227,7 +227,7 @@ HostZoomMap::ZoomLevelVector HostZoomMapImpl::GetAllZoomLevels() const {
void HostZoomMapImpl::SetZoomLevelForHost(const std::string& host,
double level) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
{
base::AutoLock auto_lock(lock_);
@@ -252,7 +252,7 @@ void HostZoomMapImpl::SetZoomLevelForHost(const std::string& host,
void HostZoomMapImpl::SetZoomLevelForHostAndScheme(const std::string& scheme,
const std::string& host,
double level) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
{
base::AutoLock auto_lock(lock_);
scheme_host_zoom_levels_[scheme][host] = level;
@@ -270,12 +270,12 @@ void HostZoomMapImpl::SetZoomLevelForHostAndScheme(const std::string& scheme,
}
double HostZoomMapImpl::GetDefaultZoomLevel() const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return default_zoom_level_;
}
void HostZoomMapImpl::SetDefaultZoomLevel(double level) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
default_zoom_level_ = level;
}
@@ -395,7 +395,7 @@ double HostZoomMapImpl::GetTemporaryZoomLevel(int render_process_id,
void HostZoomMapImpl::SetTemporaryZoomLevel(int render_process_id,
int render_view_id,
double level) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
{
RenderViewKey key(render_process_id, render_view_id);
@@ -491,7 +491,7 @@ void HostZoomMapImpl::SendErrorPageZoomLevelRefresh() {
}
HostZoomMapImpl::~HostZoomMapImpl() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
} // namespace content
diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc
index 9bfad25..21f6ad6 100644
--- a/content/browser/indexed_db/indexed_db_browsertest.cc
+++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -125,7 +125,7 @@ class IndexedDBBrowserTest : public ContentBrowserTest {
base::Bind(&IndexedDBBrowserTest::SetTempQuota, bytes, qm));
return;
}
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
qm->SetTemporaryGlobalOverrideQuota(bytes, storage::QuotaCallback());
// Don't return until the quota has been set.
scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper(
diff --git a/content/browser/indexed_db/indexed_db_callbacks.cc b/content/browser/indexed_db/indexed_db_callbacks.cc
index 147c5ab..85bf228 100644
--- a/content/browser/indexed_db/indexed_db_callbacks.cc
+++ b/content/browser/indexed_db/indexed_db_callbacks.cc
@@ -262,7 +262,7 @@ static void CreateBlobsAndSend(
scoped_refptr<IndexedDBDispatcherHost> dispatcher_host,
const std::vector<IndexedDBBlobInfo>& blob_info,
std::vector<IndexedDBMsg_BlobOrFileInfo>* blob_or_file_info) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (CreateAllBlobs(blob_info, blob_or_file_info, dispatcher_host))
dispatcher_host->Send(new MsgType(*params));
}
@@ -271,7 +271,7 @@ static void BlobLookupForCursorPrefetch(
IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params* params,
scoped_refptr<IndexedDBDispatcherHost> dispatcher_host,
const std::vector<IndexedDBValue>& values) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK_EQ(values.size(), params->blob_or_file_infos.size());
std::vector<IndexedDBValue>::const_iterator value_iter;
diff --git a/content/browser/indexed_db/indexed_db_context_impl.cc b/content/browser/indexed_db/indexed_db_context_impl.cc
index 2a6a4b4..dbc041f 100644
--- a/content/browser/indexed_db/indexed_db_context_impl.cc
+++ b/content/browser/indexed_db/indexed_db_context_impl.cc
@@ -559,7 +559,7 @@ void IndexedDBContextImpl::GotUsageAndQuota(const GURL& origin_url,
storage::QuotaStatusCode status,
int64 usage,
int64 quota) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(status == storage::kQuotaStatusOk ||
status == storage::kQuotaErrorAbort)
<< "status was " << status;
@@ -594,7 +594,7 @@ void IndexedDBContextImpl::QueryAvailableQuota(const GURL& origin_url) {
}
return;
}
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!quota_manager_proxy() || !quota_manager_proxy()->quota_manager())
return;
quota_manager_proxy()->quota_manager()->GetUsageAndQuota(
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.cc b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
index baa3a69..17e4616 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
@@ -221,7 +221,7 @@ uint32 IndexedDBDispatcherHost::TransactionIdToProcessId(
std::string IndexedDBDispatcherHost::HoldBlobData(
const IndexedDBBlobInfo& blob_info) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
std::string uuid = blob_info.uuid();
storage::BlobStorageContext* context = blob_storage_context_->context();
scoped_ptr<storage::BlobDataHandle> blob_data_handle;
@@ -247,7 +247,7 @@ std::string IndexedDBDispatcherHost::HoldBlobData(
}
void IndexedDBDispatcherHost::DropBlobData(const std::string& uuid) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
BlobDataHandleMap::iterator iter = blob_data_handle_map_.find(uuid);
if (iter != blob_data_handle_map_.end()) {
DCHECK_GE(iter->second.second, 1);
@@ -378,7 +378,7 @@ void IndexedDBDispatcherHost::OnPutHelper(
void IndexedDBDispatcherHost::OnAckReceivedBlobs(
const std::vector<std::string>& uuids) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
for (const auto& uuid : uuids)
DropBlobData(uuid);
}
diff --git a/content/browser/indexed_db/indexed_db_internals_ui.cc b/content/browser/indexed_db/indexed_db_internals_ui.cc
index 81fc46c..2dfd650 100644
--- a/content/browser/indexed_db/indexed_db_internals_ui.cc
+++ b/content/browser/indexed_db/indexed_db_internals_ui.cc
@@ -83,7 +83,7 @@ void IndexedDBInternalsUI::AddContextFromStoragePartition(
}
void IndexedDBInternalsUI::GetAllOrigins(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BrowserContext* browser_context =
web_ui()->GetWebContents()->GetBrowserContext();
@@ -116,7 +116,7 @@ void IndexedDBInternalsUI::GetAllOriginsOnIndexedDBThread(
void IndexedDBInternalsUI::OnOriginsReady(scoped_ptr<base::ListValue> origins,
const base::FilePath& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
web_ui()->CallJavascriptFunction(
"indexeddb.onOriginsReady", *origins, base::StringValue(path.value()));
}
@@ -171,7 +171,7 @@ bool IndexedDBInternalsUI::GetOriginContext(
}
void IndexedDBInternalsUI::DownloadOriginData(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::FilePath partition_path;
GURL origin_url;
@@ -190,7 +190,7 @@ void IndexedDBInternalsUI::DownloadOriginData(const base::ListValue* args) {
}
void IndexedDBInternalsUI::ForceCloseOrigin(const base::ListValue* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::FilePath partition_path;
GURL origin_url;
@@ -290,7 +290,7 @@ void IndexedDBInternalsUI::OnDownloadDataReady(
const base::FilePath temp_path,
const base::FilePath zip_path,
size_t connection_count) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
const GURL url = GURL(FILE_PATH_LITERAL("file://") + zip_path.value());
BrowserContext* browser_context =
web_ui()->GetWebContents()->GetBrowserContext();
diff --git a/content/browser/indexed_db/indexed_db_quota_client.cc b/content/browser/indexed_db/indexed_db_quota_client.cc
index d8af36c..a33e428 100644
--- a/content/browser/indexed_db/indexed_db_quota_client.cc
+++ b/content/browser/indexed_db/indexed_db_quota_client.cc
@@ -40,7 +40,7 @@ void GetAllOriginsOnIndexedDBThread(IndexedDBContextImpl* context,
void DidGetOrigins(const IndexedDBQuotaClient::GetOriginsCallback& callback,
const std::set<GURL>* origins) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
callback.Run(*origins);
}
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 29a99dd..61e458d 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -405,7 +405,7 @@ void LogResourceRequestTimeOnUI(
int render_process_id,
int render_frame_id,
const GURL& url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
RenderFrameHostImpl* host =
RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
if (host != NULL) {
@@ -436,7 +436,7 @@ ResourceDispatcherHostImpl::ResourceDispatcherHostImpl()
filter_(NULL),
delegate_(NULL),
allow_cross_origin_auth_prompt_(false) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!g_resource_dispatcher_host);
g_resource_dispatcher_host = this;
@@ -498,7 +498,7 @@ void ResourceDispatcherHostImpl::ResumeResponseDeferredAtStart(
void ResourceDispatcherHostImpl::CancelRequestsForContext(
ResourceContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(context);
CHECK(ContainsKey(active_resource_contexts_, context));
@@ -692,7 +692,7 @@ void ResourceDispatcherHostImpl::ClearLoginDelegateForRequest(
}
void ResourceDispatcherHostImpl::Shutdown() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE,
base::Bind(&ResourceDispatcherHostImpl::OnShutdown,
@@ -903,7 +903,7 @@ void ResourceDispatcherHostImpl::OnInit() {
}
void ResourceDispatcherHostImpl::OnShutdown() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
is_shutdown_ = true;
pending_loaders_.clear();
@@ -2135,7 +2135,7 @@ void ResourceDispatcherHostImpl::UpdateLoadInfoOnUIThread(
tracked_objects::ScopedTracker tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"466285 ResourceDispatcherHostImpl::UpdateLoadInfoOnUIThread"));
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
for (const auto& load_info : *info_map) {
RenderViewHostImpl* view = RenderViewHostImpl::FromID(
load_info.first.child_id, load_info.first.route_id);
@@ -2203,7 +2203,7 @@ void ResourceDispatcherHostImpl::UpdateLoadInfo() {
void ResourceDispatcherHostImpl::BlockRequestsForRoute(int child_id,
int route_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
GlobalRoutingID key(child_id, route_id);
DCHECK(blocked_loaders_map_.find(key) == blocked_loaders_map_.end()) <<
"BlockRequestsForRoute called multiple time for the same RVH";
@@ -2281,7 +2281,7 @@ bool ResourceDispatcherHostImpl::IsTransferredNavigation(
ResourceLoader* ResourceDispatcherHostImpl::GetLoader(
const GlobalRequestID& id) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
LoaderMap::const_iterator i = pending_loaders_.find(id);
if (i == pending_loaders_.end())
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc
index 7bb55f1..f8dcc0a 100644
--- a/content/browser/loader/resource_loader.cc
+++ b/content/browser/loader/resource_loader.cc
@@ -479,7 +479,7 @@ void ResourceLoader::OnReadCompleted(net::URLRequest* unused, int bytes_read) {
void ResourceLoader::CancelSSLRequest(int error,
const net::SSLInfo* ssl_info) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// The request can be NULL if it was cancelled by the renderer (as the
// request of the user navigating to a new page from the location bar).
@@ -495,7 +495,7 @@ void ResourceLoader::CancelSSLRequest(int error,
}
void ResourceLoader::ContinueSSLRequest() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DVLOG(1) << "ContinueSSLRequest() url: " << request_->url().spec();
diff --git a/content/browser/loader/temporary_file_stream.cc b/content/browser/loader/temporary_file_stream.cc
index eb3ea9e..fc57c8a 100644
--- a/content/browser/loader/temporary_file_stream.cc
+++ b/content/browser/loader/temporary_file_stream.cc
@@ -23,7 +23,7 @@ void DidCreateTemporaryFile(
scoped_ptr<base::FileProxy> file_proxy,
base::File::Error error_code,
const base::FilePath& file_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!file_proxy->IsValid()) {
callback.Run(error_code, scoped_ptr<net::FileStream>(), NULL);
@@ -50,7 +50,7 @@ void DidCreateTemporaryFile(
void CreateTemporaryFileStream(
const CreateTemporaryFileStreamCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
scoped_ptr<base::FileProxy> file_proxy(new base::FileProxy(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get()));
diff --git a/content/browser/media/android/media_resource_getter_impl.cc b/content/browser/media/android/media_resource_getter_impl.cc
index 99142e1..4577484 100644
--- a/content/browser/media/android/media_resource_getter_impl.cc
+++ b/content/browser/media/android/media_resource_getter_impl.cc
@@ -49,7 +49,7 @@ static void RequestPlatformPathFromBlobURL(
const GURL& url,
ResourceContext* resource_context,
const base::Callback<void(const std::string&)>& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ChromeBlobStorageContext* blob_storage_context =
GetChromeBlobStorageContextForResourceContext(resource_context);
@@ -81,7 +81,7 @@ static void RequestPlaformPathFromFileSystemURL(
int render_process_id,
scoped_refptr<storage::FileSystemContext> file_system_context,
const base::Callback<void(const std::string&)>& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
base::FilePath platform_path;
SyncGetPlatformPath(file_system_context.get(),
render_process_id,
@@ -200,7 +200,7 @@ MediaResourceGetterTask::~MediaResourceGetterTask() {}
net::AuthCredentials MediaResourceGetterTask::RequestAuthCredentials(
const GURL& url) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
net::HttpTransactionFactory* factory =
context_getter_->GetURLRequestContext()->http_transaction_factory();
if (!factory)
@@ -224,7 +224,7 @@ net::AuthCredentials MediaResourceGetterTask::RequestAuthCredentials(
void MediaResourceGetterTask::RequestCookies(
const GURL& url, const GURL& first_party_for_cookies,
const media::MediaResourceGetter::GetCookieCB& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ChildProcessSecurityPolicyImpl* policy =
ChildProcessSecurityPolicyImpl::GetInstance();
if (!policy->CanAccessCookiesForOrigin(render_process_id_, url)) {
@@ -253,7 +253,7 @@ void MediaResourceGetterTask::CheckPolicyForCookies(
const GURL& url, const GURL& first_party_for_cookies,
const media::MediaResourceGetter::GetCookieCB& callback,
const net::CookieList& cookie_list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (GetContentClient()->browser()->AllowGetCookie(
url, first_party_for_cookies, cookie_list,
resource_context_, render_process_id_, render_frame_id_)) {
@@ -283,7 +283,7 @@ MediaResourceGetterImpl::~MediaResourceGetterImpl() {}
void MediaResourceGetterImpl::GetAuthCredentials(
const GURL& url, const GetAuthCredentialsCB& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_refptr<MediaResourceGetterTask> task = new MediaResourceGetterTask(
browser_context_, 0, 0);
@@ -298,7 +298,7 @@ void MediaResourceGetterImpl::GetAuthCredentials(
void MediaResourceGetterImpl::GetCookies(
const GURL& url, const GURL& first_party_for_cookies,
const GetCookieCB& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_refptr<MediaResourceGetterTask> task = new MediaResourceGetterTask(
browser_context_, render_process_id_, render_frame_id_);
@@ -316,19 +316,19 @@ void MediaResourceGetterImpl::GetCookies(
void MediaResourceGetterImpl::GetAuthCredentialsCallback(
const GetAuthCredentialsCB& callback,
const net::AuthCredentials& credentials) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
callback.Run(credentials.username(), credentials.password());
}
void MediaResourceGetterImpl::GetCookiesCallback(
const GetCookieCB& callback, const std::string& cookies) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
callback.Run(cookies);
}
void MediaResourceGetterImpl::GetPlatformPathFromURL(
const GURL& url, const GetPlatformPathCB& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(url.SchemeIsFileSystem() || url.SchemeIs(url::kBlobScheme));
GetPlatformPathCB cb =
@@ -355,14 +355,14 @@ void MediaResourceGetterImpl::GetPlatformPathFromURL(
void MediaResourceGetterImpl::GetPlatformPathCallback(
const GetPlatformPathCB& callback, const std::string& platform_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
callback.Run(platform_path);
}
void MediaResourceGetterImpl::ExtractMediaMetadata(
const std::string& url, const std::string& cookies,
const std::string& user_agent, const ExtractMediaMetadataCB& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool();
pool->PostWorkerTask(
FROM_HERE,
@@ -372,7 +372,7 @@ void MediaResourceGetterImpl::ExtractMediaMetadata(
void MediaResourceGetterImpl::ExtractMediaMetadata(
const int fd, const int64 offset, const int64 size,
const ExtractMediaMetadataCB& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool();
pool->PostWorkerTask(
FROM_HERE,
diff --git a/content/browser/media/capture/content_video_capture_device_core.cc b/content/browser/media/capture/content_video_capture_device_core.cc
index 4a85a77..d730a9e 100644
--- a/content/browser/media/capture/content_video_capture_device_core.cc
+++ b/content/browser/media/capture/content_video_capture_device_core.cc
@@ -35,7 +35,7 @@ namespace {
void DeleteCaptureMachineOnUIThread(
scoped_ptr<VideoCaptureMachine> capture_machine) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
capture_machine.reset();
}
diff --git a/content/browser/media/capture/desktop_capture_device_aura.cc b/content/browser/media/capture/desktop_capture_device_aura.cc
index 1aa39cd5..93da72a 100644
--- a/content/browser/media/capture/desktop_capture_device_aura.cc
+++ b/content/browser/media/capture/desktop_capture_device_aura.cc
@@ -17,7 +17,7 @@ namespace {
void SetCaptureSource(AuraWindowCaptureMachine* machine,
const DesktopMediaID& source) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
aura::Window* window = DesktopMediaID::GetAuraWindowById(source);
machine->SetWindow(window);
diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc
index b5a9351..460b96c 100644
--- a/content/browser/media/media_internals.cc
+++ b/content/browser/media/media_internals.cc
@@ -259,7 +259,7 @@ void MediaInternals::MediaInternalsUMAHandler::Observe(
int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(type, NOTIFICATION_RENDERER_PROCESS_TERMINATED);
RenderProcessHost* process = Source<RenderProcessHost>(source).ptr();
@@ -277,7 +277,7 @@ void MediaInternals::MediaInternalsUMAHandler::Observe(
void MediaInternals::MediaInternalsUMAHandler::SavePlayerState(
const media::MediaLogEvent& event,
int render_process_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
PlayerInfoMap& player_info = renderer_info_[render_process_id];
switch (event.type) {
case media::MediaLogEvent::PIPELINE_ERROR: {
@@ -325,7 +325,7 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState(
std::string MediaInternals::MediaInternalsUMAHandler::GetUMANameForAVStream(
const PipelineInfo& player_info) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
static const char kPipelineUmaPrefix[] = "Media.PipelineStatus.AudioVideo.";
std::string uma_name = kPipelineUmaPrefix;
if (player_info.video_codec_name == "vp8") {
@@ -357,7 +357,7 @@ std::string MediaInternals::MediaInternalsUMAHandler::GetUMANameForAVStream(
void MediaInternals::MediaInternalsUMAHandler::ReportUMAForPipelineStatus(
const PipelineInfo& player_info) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (player_info.has_video && player_info.has_audio) {
base::LinearHistogram::FactoryGet(
GetUMANameForAVStream(player_info), 1, media::PIPELINE_STATUS_MAX,
@@ -387,7 +387,7 @@ void MediaInternals::MediaInternalsUMAHandler::ReportUMAForPipelineStatus(
void MediaInternals::MediaInternalsUMAHandler::LogAndClearPlayersInRenderer(
int render_process_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
auto players_it = renderer_info_.find(render_process_id);
if (players_it == renderer_info_.end())
return;
@@ -410,7 +410,7 @@ MediaInternals::~MediaInternals() {}
void MediaInternals::OnMediaEvents(
int render_process_id, const std::vector<media::MediaLogEvent>& events) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Notify observers that |event| has occurred.
for (auto event = events.begin(); event != events.end(); ++event) {
base::DictionaryValue dict;
@@ -441,12 +441,12 @@ void MediaInternals::OnMediaEvents(
}
void MediaInternals::AddUpdateCallback(const UpdateCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
update_callbacks_.push_back(callback);
}
void MediaInternals::RemoveUpdateCallback(const UpdateCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
for (size_t i = 0; i < update_callbacks_.size(); ++i) {
if (update_callbacks_[i].Equals(callback)) {
update_callbacks_.erase(update_callbacks_.begin() + i);
@@ -467,14 +467,14 @@ void MediaInternals::SendAudioStreamData() {
}
void MediaInternals::SendVideoCaptureDeviceCapabilities() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
SendUpdate(SerializeUpdate("media.onReceiveVideoCaptureCapabilities",
&video_capture_capabilities_cached_data_));
}
void MediaInternals::UpdateVideoCaptureDeviceCapabilities(
const media::VideoCaptureDeviceInfos& video_capture_device_infos) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
video_capture_capabilities_cached_data_.Clear();
for (const auto& video_capture_device_info : video_capture_device_infos) {
diff --git a/content/browser/media/media_internals_handler.cc b/content/browser/media/media_internals_handler.cc
index 74eb835..aafe26e 100644
--- a/content/browser/media/media_internals_handler.cc
+++ b/content/browser/media/media_internals_handler.cc
@@ -24,7 +24,7 @@ MediaInternalsMessageHandler::~MediaInternalsMessageHandler() {
}
void MediaInternalsMessageHandler::RegisterMessages() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
proxy_->Attach(this);
web_ui()->RegisterMessageCallback("getEverything",
diff --git a/content/browser/media/media_internals_proxy.cc b/content/browser/media/media_internals_proxy.cc
index 4193a83..1180404 100644
--- a/content/browser/media/media_internals_proxy.cc
+++ b/content/browser/media/media_internals_proxy.cc
@@ -33,7 +33,7 @@ MediaInternalsProxy::MediaInternalsProxy() {
void MediaInternalsProxy::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(type, NOTIFICATION_RENDERER_PROCESS_TERMINATED);
RenderProcessHost* process = Source<RenderProcessHost>(source).ptr();
CallJavaScriptFunctionOnUIThread("media.onRendererTerminated",
@@ -41,7 +41,7 @@ void MediaInternalsProxy::Observe(int type,
}
void MediaInternalsProxy::Attach(MediaInternalsMessageHandler* handler) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
handler_ = handler;
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -49,7 +49,7 @@ void MediaInternalsProxy::Attach(MediaInternalsMessageHandler* handler) {
}
void MediaInternalsProxy::Detach() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
handler_ = NULL;
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -58,7 +58,7 @@ void MediaInternalsProxy::Detach() {
}
void MediaInternalsProxy::GetEverything() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Ask MediaInternals for all its data.
BrowserThread::PostTask(
@@ -70,7 +70,7 @@ void MediaInternalsProxy::GetEverything() {
}
void MediaInternalsProxy::OnUpdate(const base::string16& update) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&MediaInternalsProxy::UpdateUIOnUIThread, this, update));
@@ -116,7 +116,7 @@ base::Value* MediaInternalsProxy::GetConstants() {
}
void MediaInternalsProxy::ObserveMediaInternalsOnIOThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
update_callback_ = base::Bind(&MediaInternalsProxy::OnUpdate,
base::Unretained(this));
MediaInternals::GetInstance()->AddUpdateCallback(update_callback_);
@@ -127,7 +127,7 @@ void MediaInternalsProxy::ObserveMediaInternalsOnIOThread() {
}
void MediaInternalsProxy::StopObservingMediaInternalsOnIOThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
MediaInternals::GetInstance()->RemoveUpdateCallback(update_callback_);
if (GetContentClient()->browser()->GetNetLog()) {
net::NetLog* net_log = GetContentClient()->browser()->GetNetLog();
@@ -136,20 +136,20 @@ void MediaInternalsProxy::StopObservingMediaInternalsOnIOThread() {
}
void MediaInternalsProxy::GetEverythingOnIOThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
MediaInternals::GetInstance()->SendAudioStreamData();
MediaInternals::GetInstance()->SendVideoCaptureDeviceCapabilities();
}
void MediaInternalsProxy::UpdateUIOnUIThread(const base::string16& update) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Don't forward updates to a destructed UI.
if (handler_)
handler_->OnUpdate(update);
}
void MediaInternalsProxy::AddNetEventOnUIThread(base::Value* entry) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Send the updates to the page in kMediaInternalsProxyEventDelayMilliseconds
// if an update is not already pending.
@@ -165,14 +165,14 @@ void MediaInternalsProxy::AddNetEventOnUIThread(base::Value* entry) {
}
void MediaInternalsProxy::SendNetEventsOnUIThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CallJavaScriptFunctionOnUIThread("media.onNetUpdate",
pending_net_updates_.release());
}
void MediaInternalsProxy::CallJavaScriptFunctionOnUIThread(
const std::string& function, base::Value* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_ptr<base::Value> args_value(args);
std::vector<const base::Value*> args_vector;
args_vector.push_back(args_value.get());
diff --git a/content/browser/media/webrtc_identity_store.cc b/content/browser/media/webrtc_identity_store.cc
index 419cb96..2cf8fb1 100644
--- a/content/browser/media/webrtc_identity_store.cc
+++ b/content/browser/media/webrtc_identity_store.cc
@@ -83,7 +83,7 @@ class WebRTCIdentityRequest {
common_name_(common_name) {}
void Cancel(WebRTCIdentityRequestHandle* handle) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (callbacks_.find(handle) == callbacks_.end())
return;
callbacks_.erase(handle);
@@ -104,7 +104,7 @@ class WebRTCIdentityRequest {
// WebRTCIdentityStoreBackend::FindIdentity, because it needs to live longer
// than that if the identity does not exist in DB.
void Post(const WebRTCIdentityRequestResult& result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
for (CallbackMap::iterator it = callbacks_.begin(); it != callbacks_.end();
++it)
it->second.Run(result.error, result.certificate, result.private_key);
@@ -136,7 +136,7 @@ class WebRTCIdentityRequestHandle {
// Cancel the request. Does nothing if the request finished or was already
// cancelled.
void Cancel() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!request_)
return;
@@ -149,7 +149,7 @@ class WebRTCIdentityRequestHandle {
}
void OnRequestStarted(WebRTCIdentityRequest* request) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(request);
request_ = request;
}
@@ -157,7 +157,7 @@ class WebRTCIdentityRequestHandle {
void OnRequestComplete(int error,
const std::string& certificate,
const std::string& private_key) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(request_);
request_ = NULL;
base::ResetAndReturn(&callback_).Run(error, certificate, private_key);
@@ -184,7 +184,7 @@ base::Closure WebRTCIdentityStore::RequestIdentity(
const std::string& identity_name,
const std::string& common_name,
const CompletionCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
WebRTCIdentityRequest* request =
FindRequest(origin, identity_name, common_name);
// If there is no identical request in flight, create a new one, queue it,
@@ -220,20 +220,20 @@ base::Closure WebRTCIdentityStore::RequestIdentity(
void WebRTCIdentityStore::DeleteBetween(base::Time delete_begin,
base::Time delete_end,
const base::Closure& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
backend_->DeleteBetween(delete_begin, delete_end, callback);
}
void WebRTCIdentityStore::SetValidityPeriodForTesting(
base::TimeDelta validity_period) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
validity_period_ = validity_period;
backend_->SetValidityPeriodForTesting(validity_period);
}
void WebRTCIdentityStore::SetTaskRunnerForTesting(
const scoped_refptr<base::TaskRunner>& task_runner) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
task_runner_ = task_runner;
}
@@ -241,7 +241,7 @@ void WebRTCIdentityStore::BackendFindCallback(WebRTCIdentityRequest* request,
int error,
const std::string& certificate,
const std::string& private_key) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (error == net::OK) {
DVLOG(2) << "Identity found in DB.";
WebRTCIdentityRequestResult result(error, certificate, private_key);
@@ -270,7 +270,7 @@ void WebRTCIdentityStore::BackendFindCallback(WebRTCIdentityRequest* request,
void WebRTCIdentityStore::GenerateIdentityCallback(
WebRTCIdentityRequest* request,
WebRTCIdentityRequestResult* result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (result->error == net::OK) {
DVLOG(2) << "New identity generated and added to the backend.";
backend_->AddIdentity(request->origin_,
@@ -285,7 +285,7 @@ void WebRTCIdentityStore::GenerateIdentityCallback(
void WebRTCIdentityStore::PostRequestResult(
WebRTCIdentityRequest* request,
const WebRTCIdentityRequestResult& result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Removes the in flight request from the queue.
for (size_t i = 0; i < in_flight_requests_.size(); ++i) {
if (in_flight_requests_[i] == request) {
diff --git a/content/browser/media/webrtc_identity_store_backend.cc b/content/browser/media/webrtc_identity_store_backend.cc
index f6ecbad..32ef512 100644
--- a/content/browser/media/webrtc_identity_store_backend.cc
+++ b/content/browser/media/webrtc_identity_store_backend.cc
@@ -129,7 +129,7 @@ class WebRTCIdentityStoreBackend::SqlLiteStorage
void DeleteBetween(base::Time delete_begin, base::Time delete_end);
void SetValidityPeriodForTesting(base::TimeDelta validity_period) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
DCHECK(!db_.get());
validity_period_ = validity_period;
}
@@ -191,7 +191,7 @@ bool WebRTCIdentityStoreBackend::FindIdentity(
const std::string& identity_name,
const std::string& common_name,
const FindIdentityCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (state_ == CLOSED)
return false;
@@ -252,7 +252,7 @@ void WebRTCIdentityStoreBackend::AddIdentity(const GURL& origin,
const std::string& common_name,
const std::string& certificate,
const std::string& private_key) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (state_ == CLOSED)
return;
@@ -304,7 +304,7 @@ void WebRTCIdentityStoreBackend::Close() {
void WebRTCIdentityStoreBackend::DeleteBetween(base::Time delete_begin,
base::Time delete_end,
const base::Closure& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (state_ == CLOSED)
return;
@@ -329,7 +329,7 @@ void WebRTCIdentityStoreBackend::DeleteBetween(base::Time delete_begin,
void WebRTCIdentityStoreBackend::SetValidityPeriodForTesting(
base::TimeDelta validity_period) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
validity_period_ = validity_period;
BrowserThread::PostTask(
BrowserThread::DB,
@@ -342,7 +342,7 @@ void WebRTCIdentityStoreBackend::SetValidityPeriodForTesting(
WebRTCIdentityStoreBackend::~WebRTCIdentityStoreBackend() {}
void WebRTCIdentityStoreBackend::OnLoaded(scoped_ptr<IdentityMap> out_map) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (state_ != LOADING)
return;
@@ -367,7 +367,7 @@ void WebRTCIdentityStoreBackend::OnLoaded(scoped_ptr<IdentityMap> out_map) {
//
void WebRTCIdentityStoreBackend::SqlLiteStorage::Load(IdentityMap* out_map) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
DCHECK(!db_.get());
// Ensure the parent directory for storing certs is created before reading
@@ -421,7 +421,7 @@ void WebRTCIdentityStoreBackend::SqlLiteStorage::Load(IdentityMap* out_map) {
}
void WebRTCIdentityStoreBackend::SqlLiteStorage::Close() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
Commit();
db_.reset();
}
@@ -430,7 +430,7 @@ void WebRTCIdentityStoreBackend::SqlLiteStorage::AddIdentity(
const GURL& origin,
const std::string& identity_name,
const Identity& identity) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
if (!db_.get())
return;
@@ -447,7 +447,7 @@ void WebRTCIdentityStoreBackend::SqlLiteStorage::DeleteIdentity(
const GURL& origin,
const std::string& identity_name,
const Identity& identity) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
if (!db_.get())
return;
BatchOperation(DELETE_IDENTITY, origin, identity_name, identity);
@@ -456,7 +456,7 @@ void WebRTCIdentityStoreBackend::SqlLiteStorage::DeleteIdentity(
void WebRTCIdentityStoreBackend::SqlLiteStorage::DeleteBetween(
base::Time delete_begin,
base::Time delete_end) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
if (!db_.get())
return;
@@ -490,7 +490,7 @@ void WebRTCIdentityStoreBackend::SqlLiteStorage::DeleteBetween(
void WebRTCIdentityStoreBackend::SqlLiteStorage::OnDatabaseError(
int error,
sql::Statement* stmt) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
db_->RazeAndClose();
// It's not safe to reset |db_| here.
@@ -501,7 +501,7 @@ void WebRTCIdentityStoreBackend::SqlLiteStorage::BatchOperation(
const GURL& origin,
const std::string& identity_name,
const Identity& identity) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
// Commit every 30 seconds.
static const base::TimeDelta kCommitInterval(
base::TimeDelta::FromSeconds(30));
@@ -529,7 +529,7 @@ void WebRTCIdentityStoreBackend::SqlLiteStorage::BatchOperation(
}
void WebRTCIdentityStoreBackend::SqlLiteStorage::Commit() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ DCHECK_CURRENTLY_ON(BrowserThread::DB);
// Maybe an old timer fired or we are already Close()'ed.
if (!db_.get() || pending_operations_.empty())
return;
diff --git a/content/browser/media/webrtc_internals.cc b/content/browser/media/webrtc_internals.cc
index 693c4db..952633c 100644
--- a/content/browser/media/webrtc_internals.cc
+++ b/content/browser/media/webrtc_internals.cc
@@ -73,7 +73,7 @@ void WebRTCInternals::OnAddPeerConnection(int render_process_id,
const string& url,
const string& rtc_configuration,
const string& constraints) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::DictionaryValue* dict = new base::DictionaryValue();
if (!dict)
@@ -93,7 +93,7 @@ void WebRTCInternals::OnAddPeerConnection(int render_process_id,
}
void WebRTCInternals::OnRemovePeerConnection(ProcessId pid, int lid) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
for (size_t i = 0; i < peer_connection_data_.GetSize(); ++i) {
base::DictionaryValue* dict = NULL;
peer_connection_data_.GetDictionary(i, &dict);
@@ -121,7 +121,7 @@ void WebRTCInternals::OnRemovePeerConnection(ProcessId pid, int lid) {
void WebRTCInternals::OnUpdatePeerConnection(
ProcessId pid, int lid, const string& type, const string& value) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
for (size_t i = 0; i < peer_connection_data_.GetSize(); ++i) {
base::DictionaryValue* record = NULL;
@@ -187,7 +187,7 @@ void WebRTCInternals::OnGetUserMedia(int rid,
bool video,
const std::string& audio_constraints,
const std::string& video_constraints) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::DictionaryValue* dict = new base::DictionaryValue();
dict->SetInteger("rid", rid);
@@ -205,12 +205,12 @@ void WebRTCInternals::OnGetUserMedia(int rid,
}
void WebRTCInternals::AddObserver(WebRTCInternalsUIObserver *observer) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
observers_.AddObserver(observer);
}
void WebRTCInternals::RemoveObserver(WebRTCInternalsUIObserver *observer) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
observers_.RemoveObserver(observer);
// Disables the AEC recording if it is enabled and the last webrtc-internals
@@ -220,7 +220,7 @@ void WebRTCInternals::RemoveObserver(WebRTCInternalsUIObserver *observer) {
}
void WebRTCInternals::UpdateObserver(WebRTCInternalsUIObserver* observer) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (peer_connection_data_.GetSize() > 0)
observer->OnUpdate("updateAllPeerConnections", &peer_connection_data_);
@@ -266,7 +266,7 @@ void WebRTCInternals::DisableAecDump() {
}
void WebRTCInternals::ResetForTesting() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
observers_.Clear();
peer_connection_data_.Clear();
CreateOrReleasePowerSaveBlocker();
@@ -285,7 +285,7 @@ void WebRTCInternals::SendUpdate(const string& command, base::Value* value) {
void WebRTCInternals::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(type, NOTIFICATION_RENDERER_PROCESS_TERMINATED);
OnRendererExit(Source<RenderProcessHost>(source)->GetID());
}
@@ -306,7 +306,7 @@ void WebRTCInternals::FileSelectionCanceled(void* params) {
}
void WebRTCInternals::OnRendererExit(int render_process_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Iterates from the end of the list to remove the PeerConnections created
// by the exitting renderer.
@@ -368,7 +368,7 @@ void WebRTCInternals::EnableAecDumpOnAllRenderProcessHosts() {
#endif
void WebRTCInternals::CreateOrReleasePowerSaveBlocker() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (peer_connection_data_.empty() && power_save_blocker_) {
DVLOG(1) << ("Releasing the block on application suspension since no "
diff --git a/content/browser/media/webrtc_internals_message_handler.cc b/content/browser/media/webrtc_internals_message_handler.cc
index bffd509..8bfae99 100644
--- a/content/browser/media/webrtc_internals_message_handler.cc
+++ b/content/browser/media/webrtc_internals_message_handler.cc
@@ -73,7 +73,7 @@ void WebRTCInternalsMessageHandler::OnDOMLoadDone(
void WebRTCInternalsMessageHandler::OnUpdate(const std::string& command,
const base::Value* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::vector<const base::Value*> args_vector;
if (args)
args_vector.push_back(args);
diff --git a/content/browser/pepper_flash_settings_helper_impl.cc b/content/browser/pepper_flash_settings_helper_impl.cc
index f51248c..2524dbb 100644
--- a/content/browser/pepper_flash_settings_helper_impl.cc
+++ b/content/browser/pepper_flash_settings_helper_impl.cc
@@ -25,7 +25,7 @@ PepperFlashSettingsHelperImpl::~PepperFlashSettingsHelperImpl() {
void PepperFlashSettingsHelperImpl::OpenChannelToBroker(
const base::FilePath& path,
const OpenChannelCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (callback.is_null())
return;
@@ -52,7 +52,7 @@ void PepperFlashSettingsHelperImpl::OnPpapiChannelOpened(
const IPC::ChannelHandle& channel_handle,
base::ProcessId /* plugin_pid */,
int /* plugin_child_id */) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(!callback_.is_null());
if (!channel_handle.name.empty())
diff --git a/content/browser/plugin_data_remover_impl.cc b/content/browser/plugin_data_remover_impl.cc
index 019f4b0..43930ba 100644
--- a/content/browser/plugin_data_remover_impl.cc
+++ b/content/browser/plugin_data_remover_impl.cc
@@ -69,7 +69,7 @@ class PluginDataRemoverImpl::Context
is_removing_(false),
browser_context_path_(browser_context->GetPath()),
resource_context_(browser_context->GetResourceContext()) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
void Init(const std::string& mime_type) {
@@ -95,7 +95,7 @@ class PluginDataRemoverImpl::Context
if (!plugins.empty()) // May be empty for some tests.
plugin_path = plugins[0].path;
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
remove_start_time_ = base::Time::Now();
is_removing_ = true;
// Balanced in On[Ppapi]ChannelOpened or OnError. Exactly one them will
@@ -214,7 +214,7 @@ class PluginDataRemoverImpl::Context
// Connects the client side of a newly opened plugin channel.
void ConnectToChannel(const IPC::ChannelHandle& handle, bool is_ppapi) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// If we timed out, don't bother connecting.
if (!is_removing_)
@@ -264,7 +264,7 @@ class PluginDataRemoverImpl::Context
// Signals that we are finished with removing data (successful or not). This
// method is safe to call multiple times.
void SignalDone() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!is_removing_)
return;
is_removing_ = false;
diff --git a/content/browser/plugin_loader_posix.cc b/content/browser/plugin_loader_posix.cc
index 3523d32..b8750ed 100644
--- a/content/browser/plugin_loader_posix.cc
+++ b/content/browser/plugin_loader_posix.cc
@@ -24,7 +24,7 @@ PluginLoaderPosix::PluginLoaderPosix()
void PluginLoaderPosix::GetPlugins(
const PluginService::GetPluginsCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
std::vector<WebPluginInfo> cached_plugins;
if (PluginList::Singleton()->GetPluginsNoRefresh(&cached_plugins)) {
@@ -98,7 +98,7 @@ PluginLoaderPosix::~PluginLoaderPosix() {
}
void PluginLoaderPosix::GetPluginsToLoad() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
base::TimeTicks start_time(base::TimeTicks::Now());
@@ -123,7 +123,7 @@ void PluginLoaderPosix::GetPluginsToLoad() {
}
void PluginLoaderPosix::LoadPluginsInternal() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Check if the list is empty or all plugins have already been loaded before
// forking.
diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc
index 3d45743..9bb8cf8 100644
--- a/content/browser/plugin_process_host.cc
+++ b/content/browser/plugin_process_host.cc
@@ -146,7 +146,7 @@ PluginProcessHost::~PluginProcessHost() {
PostMessage(*window_index, WM_CLOSE, 0, 0);
}
#elif defined(OS_MACOSX)
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// If the plugin process crashed but had fullscreen windows open at the time,
// make sure that the menu bar is visible.
for (size_t i = 0; i < plugin_fullscreen_windows_set_.size(); ++i) {
@@ -273,7 +273,7 @@ bool PluginProcessHost::Init(const WebPluginInfo& info) {
}
void PluginProcessHost::ForceShutdown() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown());
process_->ForceShutdown();
}
diff --git a/content/browser/plugin_process_host_mac.cc b/content/browser/plugin_process_host_mac.cc
index c9ee2bd..c7ece47 100644
--- a/content/browser/plugin_process_host_mac.cc
+++ b/content/browser/plugin_process_host_mac.cc
@@ -83,7 +83,7 @@ void PluginProcessHost::OnPluginHideWindow(uint32 window_id,
}
void PluginProcessHost::OnAppActivation() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// If our plugin process has any modal windows up, we need to bring it forward
// so that they act more like an in-process modal window would.
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc
index e431095..4c52514 100644
--- a/content/browser/plugin_service_impl.cc
+++ b/content/browser/plugin_service_impl.cc
@@ -99,7 +99,7 @@ void WillLoadPluginsCallback(
#if defined(OS_MACOSX)
void NotifyPluginsOfActivation() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
for (PluginProcessHostIterator iter; !iter.Done(); ++iter)
iter->OnAppActivation();
@@ -277,7 +277,7 @@ PpapiPluginProcessHost* PluginServiceImpl::FindPpapiBrokerProcess(
PluginProcessHost* PluginServiceImpl::FindOrStartNpapiPluginProcess(
int render_process_id,
const base::FilePath& plugin_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path))
return NULL;
@@ -318,7 +318,7 @@ PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess(
int render_process_id,
const base::FilePath& plugin_path,
const base::FilePath& profile_data_directory) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) {
VLOG(1) << "Unable to load ppapi plugin: " << plugin_path.MaybeAsASCII();
@@ -361,7 +361,7 @@ PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess(
PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiBrokerProcess(
int render_process_id,
const base::FilePath& plugin_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path))
return NULL;
@@ -389,7 +389,7 @@ void PluginServiceImpl::OpenChannelToNpapiPlugin(
const GURL& page_url,
const std::string& mime_type,
PluginProcessHost::Client* client) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(!ContainsKey(pending_plugin_clients_, client));
pending_plugin_clients_.insert(client);
@@ -436,7 +436,7 @@ void PluginServiceImpl::OpenChannelToPpapiBroker(
void PluginServiceImpl::CancelOpenChannelToNpapiPlugin(
PluginProcessHost::Client* client) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(ContainsKey(pending_plugin_clients_, client));
pending_plugin_clients_.erase(client);
}
@@ -484,7 +484,7 @@ void PluginServiceImpl::FinishOpenChannelToPlugin(
int render_process_id,
const base::FilePath& plugin_path,
PluginProcessHost::Client* client) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Make sure it hasn't been canceled yet.
if (!ContainsKey(pending_plugin_clients_, client))
@@ -623,7 +623,7 @@ void PluginServiceImpl::GetPluginsInternal(
void PluginServiceImpl::GetPluginsOnIOThread(
base::MessageLoopProxy* target_loop,
const GetPluginsCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// If we switch back to loading plugins in process, then we need to make
// sure g_thread_init() gets called since plugins may call glib at load.
@@ -717,7 +717,7 @@ static const unsigned int kMaxCrashesPerInterval = 3;
static const unsigned int kCrashesInterval = 120;
void PluginServiceImpl::RegisterPluginCrash(const base::FilePath& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
std::map<base::FilePath, std::vector<base::Time> >::iterator i =
crash_times_.find(path);
if (i == crash_times_.end()) {
@@ -732,7 +732,7 @@ void PluginServiceImpl::RegisterPluginCrash(const base::FilePath& path) {
}
bool PluginServiceImpl::IsPluginUnstable(const base::FilePath& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
std::map<base::FilePath, std::vector<base::Time> >::const_iterator i =
crash_times_.find(path);
if (i == crash_times_.end()) {
diff --git a/content/browser/plugin_service_impl_browsertest.cc b/content/browser/plugin_service_impl_browsertest.cc
index 710840e..b81b78c 100644
--- a/content/browser/plugin_service_impl_browsertest.cc
+++ b/content/browser/plugin_service_impl_browsertest.cc
@@ -24,7 +24,7 @@ namespace content {
const char kNPAPITestPluginMimeType[] = "application/vnd.npapi-test";
void OpenChannel(PluginProcessHost::Client* client) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Start opening the channel
PluginServiceImpl::GetInstance()->OpenChannelToNpapiPlugin(
0, 0, GURL(), GURL(), kNPAPITestPluginMimeType, client);
@@ -250,13 +250,13 @@ class MockCanceledBeforeSentPluginProcessHostClient
// Client implementation.
void SetPluginInfo(const WebPluginInfo& info) override {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ASSERT_TRUE(info.mime_types.size());
ASSERT_EQ(kNPAPITestPluginMimeType, info.mime_types[0].mime_type);
set_plugin_info_called_ = true;
}
void OnFoundPluginProcessHost(PluginProcessHost* host) override {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
set_on_found_plugin_process_host_called();
set_host(host);
// This gets called right before we request the plugin<=>renderer channel,
@@ -327,7 +327,7 @@ class MockCanceledAfterSentPluginProcessHostClient
// We override this guy again since we don't want to cancel yet.
void OnFoundPluginProcessHost(PluginProcessHost* host) override {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
set_on_found_plugin_process_host_called();
set_host(host);
}
diff --git a/content/browser/power_profiler/power_profiler_service.cc b/content/browser/power_profiler/power_profiler_service.cc
index 84ddb1b..9961b6f 100644
--- a/content/browser/power_profiler/power_profiler_service.cc
+++ b/content/browser/power_profiler/power_profiler_service.cc
@@ -14,7 +14,7 @@ namespace content {
PowerProfilerService::PowerProfilerService()
: status_(UNINITIALIZED),
data_provider_(PowerDataProvider::Create()) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// No provider supported for current platform.
if (!data_provider_.get())
@@ -33,7 +33,7 @@ PowerProfilerService::PowerProfilerService(
status_(UNINITIALIZED),
sample_period_(sample_period),
data_provider_(provider.Pass()) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (data_provider_.get())
status_ = INITIALIZED;
diff --git a/content/browser/power_save_blocker_android.cc b/content/browser/power_save_blocker_android.cc
index be23212..1e91625 100644
--- a/content/browser/power_save_blocker_android.cc
+++ b/content/browser/power_save_blocker_android.cc
@@ -41,7 +41,7 @@ class PowerSaveBlockerImpl::Delegate
};
void PowerSaveBlockerImpl::Delegate::ApplyBlock() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> j_object = j_view_android_.get(env);
if (j_object.obj())
@@ -49,7 +49,7 @@ void PowerSaveBlockerImpl::Delegate::ApplyBlock() {
}
void PowerSaveBlockerImpl::Delegate::RemoveBlock() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> j_object = j_view_android_.get(env);
if (j_object.obj())
diff --git a/content/browser/power_save_blocker_chromeos.cc b/content/browser/power_save_blocker_chromeos.cc
index 854a1ef..83c6e8a 100644
--- a/content/browser/power_save_blocker_chromeos.cc
+++ b/content/browser/power_save_blocker_chromeos.cc
@@ -44,7 +44,7 @@ class PowerSaveBlockerImpl::Delegate
: type_(type), reason_(reason), description_(description), block_id_(0) {}
void ApplyBlock() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!chromeos::PowerPolicyController::IsInitialized())
return;
@@ -64,7 +64,7 @@ class PowerSaveBlockerImpl::Delegate
}
void RemoveBlock() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!chromeos::PowerPolicyController::IsInitialized())
return;
diff --git a/content/browser/power_save_blocker_win.cc b/content/browser/power_save_blocker_win.cc
index 75b8e00..6d28411 100644
--- a/content/browser/power_save_blocker_win.cc
+++ b/content/browser/power_save_blocker_win.cc
@@ -134,7 +134,7 @@ class PowerSaveBlockerImpl::Delegate
};
void PowerSaveBlockerImpl::Delegate::ApplyBlock() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (base::win::GetVersion() < base::win::VERSION_WIN7)
return ApplySimpleBlock(type_, 1);
@@ -142,7 +142,7 @@ void PowerSaveBlockerImpl::Delegate::ApplyBlock() {
}
void PowerSaveBlockerImpl::Delegate::RemoveBlock() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (base::win::GetVersion() < base::win::VERSION_WIN7)
return ApplySimpleBlock(type_, -1);
diff --git a/content/browser/power_save_blocker_x11.cc b/content/browser/power_save_blocker_x11.cc
index 58e1e49..9cd6113 100644
--- a/content/browser/power_save_blocker_x11.cc
+++ b/content/browser/power_save_blocker_x11.cc
@@ -157,7 +157,7 @@ void PowerSaveBlockerImpl::Delegate::CleanUp() {
}
void PowerSaveBlockerImpl::Delegate::InitOnUIThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::AutoLock lock(lock_);
api_ = SelectAPI();
if (enqueue_apply_ && api_ != NO_API) {
@@ -171,7 +171,7 @@ void PowerSaveBlockerImpl::Delegate::InitOnUIThread() {
}
void PowerSaveBlockerImpl::Delegate::ApplyBlock(DBusAPI api) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
DCHECK(!bus_.get()); // ApplyBlock() should only be called once.
dbus::Bus::Options options;
@@ -251,7 +251,7 @@ void PowerSaveBlockerImpl::Delegate::ApplyBlock(DBusAPI api) {
}
void PowerSaveBlockerImpl::Delegate::RemoveBlock(DBusAPI api) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
DCHECK(bus_.get()); // RemoveBlock() should only be called once.
scoped_refptr<dbus::ObjectProxy> object_proxy;
diff --git a/content/browser/profiler_controller_impl.cc b/content/browser/profiler_controller_impl.cc
index 27c95ed..5312628 100644
--- a/content/browser/profiler_controller_impl.cc
+++ b/content/browser/profiler_controller_impl.cc
@@ -33,7 +33,7 @@ ProfilerControllerImpl::~ProfilerControllerImpl() {
void ProfilerControllerImpl::OnPendingProcesses(int sequence_number,
int pending_processes,
bool end) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (subscriber_)
subscriber_->OnPendingProcesses(sequence_number, pending_processes, end);
}
@@ -53,7 +53,7 @@ void ProfilerControllerImpl::OnProfilerDataCollected(
return;
}
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (subscriber_) {
subscriber_->OnProfilerDataCollected(sequence_number, profiler_data,
process_type);
@@ -61,7 +61,7 @@ void ProfilerControllerImpl::OnProfilerDataCollected(
}
void ProfilerControllerImpl::Register(ProfilerSubscriber* subscriber) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!subscriber_);
subscriber_ = subscriber;
}
@@ -73,7 +73,7 @@ void ProfilerControllerImpl::Unregister(const ProfilerSubscriber* subscriber) {
void ProfilerControllerImpl::GetProfilerDataFromChildProcesses(
int sequence_number) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
int pending_processes = 0;
for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) {
@@ -101,7 +101,7 @@ void ProfilerControllerImpl::GetProfilerDataFromChildProcesses(
}
void ProfilerControllerImpl::GetProfilerData(int sequence_number) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
int pending_processes = 0;
for (RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator());
diff --git a/content/browser/push_messaging/push_messaging_router.cc b/content/browser/push_messaging/push_messaging_router.cc
index 72a081d..68d15af 100644
--- a/content/browser/push_messaging/push_messaging_router.cc
+++ b/content/browser/push_messaging/push_messaging_router.cc
@@ -22,7 +22,7 @@ void PushMessagingRouter::DeliverMessage(
int64 service_worker_registration_id,
const std::string& data,
const DeliverMessageCallback& deliver_message_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
StoragePartition* partition =
BrowserContext::GetStoragePartitionForSite(browser_context, origin);
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context =
@@ -46,7 +46,7 @@ void PushMessagingRouter::FindServiceWorkerRegistration(
const std::string& data,
const DeliverMessageCallback& deliver_message_callback,
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Try to acquire the registration from storage. If it's already live we'll
// receive it right away. If not, it will be revived from storage.
service_worker_context->context()->storage()->FindRegistrationForId(
@@ -64,7 +64,7 @@ void PushMessagingRouter::FindServiceWorkerRegistrationCallback(
ServiceWorkerStatusCode service_worker_status,
const scoped_refptr<ServiceWorkerRegistration>&
service_worker_registration) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (service_worker_status == SERVICE_WORKER_OK) {
// Hold on to the service worker registration in the callback to keep it
// alive until the callback dies. Otherwise the registration could be
@@ -90,7 +90,7 @@ void PushMessagingRouter::DeliverMessageEnd(
const DeliverMessageCallback& deliver_message_callback,
const scoped_refptr<ServiceWorkerRegistration>& service_worker_registration,
ServiceWorkerStatusCode service_worker_status) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// TODO(mvanouwerkerk): UMA logging.
PushDeliveryStatus delivery_status =
PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR;