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

Side by Side Diff: content/browser/file_system/file_system_dispatcher_host.cc

Issue 8919017: Split UserMetrics into API vs. implementation. Move API to content/public. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Version for commit (merged again). Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/file_system/file_system_dispatcher_host.h" 5 #include "content/browser/file_system/file_system_dispatcher_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
11 #include "base/platform_file.h" 11 #include "base/platform_file.h"
12 #include "base/threading/thread.h" 12 #include "base/threading/thread.h"
13 #include "base/time.h" 13 #include "base/time.h"
14 #include "content/browser/user_metrics.h"
15 #include "content/common/file_system_messages.h" 14 #include "content/common/file_system_messages.h"
15 #include "content/public/browser/user_metrics.h"
16 #include "googleurl/src/gurl.h" 16 #include "googleurl/src/gurl.h"
17 #include "ipc/ipc_platform_file.h" 17 #include "ipc/ipc_platform_file.h"
18 #include "net/url_request/url_request_context.h" 18 #include "net/url_request/url_request_context.h"
19 #include "net/url_request/url_request_context_getter.h" 19 #include "net/url_request/url_request_context_getter.h"
20 #include "webkit/fileapi/file_system_callback_dispatcher.h" 20 #include "webkit/fileapi/file_system_callback_dispatcher.h"
21 #include "webkit/fileapi/file_system_context.h" 21 #include "webkit/fileapi/file_system_context.h"
22 #include "webkit/fileapi/file_system_operation.h" 22 #include "webkit/fileapi/file_system_operation.h"
23 #include "webkit/fileapi/file_system_operation.h" 23 #include "webkit/fileapi/file_system_operation.h"
24 #include "webkit/fileapi/file_system_quota_util.h" 24 #include "webkit/fileapi/file_system_quota_util.h"
25 #include "webkit/fileapi/file_system_util.h" 25 #include "webkit/fileapi/file_system_util.h"
26 26
27 using content::BrowserThread; 27 using content::BrowserThread;
28 using content::UserMetricsAction;
28 using fileapi::FileSystemCallbackDispatcher; 29 using fileapi::FileSystemCallbackDispatcher;
29 using fileapi::FileSystemFileUtil; 30 using fileapi::FileSystemFileUtil;
30 using fileapi::FileSystemOperation; 31 using fileapi::FileSystemOperation;
31 using fileapi::FileSystemOperationContext; 32 using fileapi::FileSystemOperationContext;
32 33
33 class BrowserFileSystemCallbackDispatcher 34 class BrowserFileSystemCallbackDispatcher
34 : public FileSystemCallbackDispatcher { 35 : public FileSystemCallbackDispatcher {
35 public: 36 public:
36 BrowserFileSystemCallbackDispatcher( 37 BrowserFileSystemCallbackDispatcher(
37 FileSystemDispatcherHost* dispatcher_host, int request_id) 38 FileSystemDispatcherHost* dispatcher_host, int request_id)
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 OnSyncGetPlatformPath) 159 OnSyncGetPlatformPath)
159 IPC_MESSAGE_UNHANDLED(handled = false) 160 IPC_MESSAGE_UNHANDLED(handled = false)
160 IPC_END_MESSAGE_MAP_EX() 161 IPC_END_MESSAGE_MAP_EX()
161 return handled; 162 return handled;
162 } 163 }
163 164
164 void FileSystemDispatcherHost::OnOpen( 165 void FileSystemDispatcherHost::OnOpen(
165 int request_id, const GURL& origin_url, fileapi::FileSystemType type, 166 int request_id, const GURL& origin_url, fileapi::FileSystemType type,
166 int64 requested_size, bool create) { 167 int64 requested_size, bool create) {
167 if (type == fileapi::kFileSystemTypeTemporary) { 168 if (type == fileapi::kFileSystemTypeTemporary) {
168 UserMetrics::RecordAction(UserMetricsAction("OpenFileSystemTemporary")); 169 content::RecordAction(UserMetricsAction("OpenFileSystemTemporary"));
169 } else if (type == fileapi::kFileSystemTypePersistent) { 170 } else if (type == fileapi::kFileSystemTypePersistent) {
170 UserMetrics::RecordAction(UserMetricsAction("OpenFileSystemPersistent")); 171 content::RecordAction(UserMetricsAction("OpenFileSystemPersistent"));
171 } 172 }
172 GetNewOperation(request_id)->OpenFileSystem(origin_url, type, create); 173 GetNewOperation(request_id)->OpenFileSystem(origin_url, type, create);
173 } 174 }
174 175
175 void FileSystemDispatcherHost::OnMove( 176 void FileSystemDispatcherHost::OnMove(
176 int request_id, const GURL& src_path, const GURL& dest_path) { 177 int request_id, const GURL& src_path, const GURL& dest_path) {
177 GetNewOperation(request_id)->Move(src_path, dest_path); 178 GetNewOperation(request_id)->Move(src_path, dest_path);
178 } 179 }
179 180
180 void FileSystemDispatcherHost::OnCopy( 181 void FileSystemDispatcherHost::OnCopy(
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), 313 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
313 context_); 314 context_);
314 operations_.AddWithID(operation, request_id); 315 operations_.AddWithID(operation, request_id);
315 return operation; 316 return operation;
316 } 317 }
317 318
318 void FileSystemDispatcherHost::UnregisterOperation(int request_id) { 319 void FileSystemDispatcherHost::UnregisterOperation(int request_id) {
319 DCHECK(operations_.Lookup(request_id)); 320 DCHECK(operations_.Lookup(request_id));
320 operations_.Remove(request_id); 321 operations_.Remove(request_id);
321 } 322 }
OLDNEW
« no previous file with comments | « content/browser/browser_message_filter.cc ('k') | content/browser/in_process_webkit/indexed_db_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698