Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: content/worker/worker_webkitplatformsupport_impl.cc

Issue 10451076: Adding UMA for sync IPCs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/worker/worker_webkitplatformsupport_impl.h" 5 #include "content/worker/worker_webkitplatformsupport_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/platform_file.h" 8 #include "base/platform_file.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "content/common/database_util.h" 10 #include "content/common/database_util.h"
11 #include "content/common/file_utilities_messages.h"
11 #include "content/common/fileapi/webblobregistry_impl.h" 12 #include "content/common/fileapi/webblobregistry_impl.h"
12 #include "content/common/fileapi/webfilesystem_impl.h" 13 #include "content/common/fileapi/webfilesystem_impl.h"
13 #include "content/common/file_utilities_messages.h"
14 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" 14 #include "content/common/indexed_db/proxy_webidbfactory_impl.h"
15 #include "content/common/mime_registry_messages.h" 15 #include "content/common/mime_registry_messages.h"
16 #include "content/common/webmessageportchannel_impl.h" 16 #include "content/common/webmessageportchannel_impl.h"
17 #include "content/public/browser/user_metrics.h"
jochen (gone - plz use gerrit) 2012/05/30 08:28:09 you can't include browser headers in worker or ren
17 #include "content/worker/worker_thread.h" 18 #include "content/worker/worker_thread.h"
18 #include "ipc/ipc_sync_message_filter.h" 19 #include "ipc/ipc_sync_message_filter.h"
19 #include "net/base/mime_util.h" 20 #include "net/base/mime_util.h"
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h"
21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis try.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis try.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 23 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
23 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 24 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
24 #include "webkit/glue/webfileutilities_impl.h" 25 #include "webkit/glue/webfileutilities_impl.h"
25 #include "webkit/glue/webkit_glue.h" 26 #include "webkit/glue/webkit_glue.h"
26 27
(...skipping 16 matching lines...) Expand all
43 class WorkerWebKitPlatformSupportImpl::FileUtilities 44 class WorkerWebKitPlatformSupportImpl::FileUtilities
44 : public webkit_glue::WebFileUtilitiesImpl { 45 : public webkit_glue::WebFileUtilitiesImpl {
45 public: 46 public:
46 virtual bool getFileSize(const WebKit::WebString& path, long long& result); 47 virtual bool getFileSize(const WebKit::WebString& path, long long& result);
47 virtual bool getFileModificationTime(const WebKit::WebString& path, 48 virtual bool getFileModificationTime(const WebKit::WebString& path,
48 double& result); 49 double& result);
49 virtual bool getFileInfo(const WebString& path, WebFileInfo& result); 50 virtual bool getFileInfo(const WebString& path, WebFileInfo& result);
50 }; 51 };
51 52
52 static bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) { 53 static bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) {
54 content::RecordAction(UserMetricsAction("SendSyncIPC_Worker"));
55
53 WorkerThread* worker_thread = WorkerThread::current(); 56 WorkerThread* worker_thread = WorkerThread::current();
54 if (worker_thread) 57 if (worker_thread)
55 return worker_thread->Send(msg); 58 return worker_thread->Send(msg);
56 59
57 scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter( 60 scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter(
58 ChildThread::current()->sync_message_filter()); 61 ChildThread::current()->sync_message_filter());
59 return sync_msg_filter->Send(msg); 62 return sync_msg_filter->Send(msg);
60 } 63 }
61 64
62 bool WorkerWebKitPlatformSupportImpl::FileUtilities::getFileSize( 65 bool WorkerWebKitPlatformSupportImpl::FileUtilities::getFileSize(
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 new MimeRegistryMsg_GetPreferredExtensionForMimeType( 309 new MimeRegistryMsg_GetPreferredExtensionForMimeType(
307 UTF16ToASCII(mime_type), &file_extension)); 310 UTF16ToASCII(mime_type), &file_extension));
308 return webkit_glue::FilePathStringToWebString(file_extension); 311 return webkit_glue::FilePathStringToWebString(file_extension);
309 } 312 }
310 313
311 WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() { 314 WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() {
312 if (!blob_registry_.get()) 315 if (!blob_registry_.get())
313 blob_registry_.reset(new WebBlobRegistryImpl(WorkerThread::current())); 316 blob_registry_.reset(new WebBlobRegistryImpl(WorkerThread::current()));
314 return blob_registry_.get(); 317 return blob_registry_.get();
315 } 318 }
OLDNEW
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698