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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.cc

Issue 2728323002: Network traffic annotation added to drive/base_requests. (Closed)
Patch Set: Annoatation udpated. Created 3 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/sync_file_system/drive_backend/sync_engine.h" 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "components/drive/service/drive_service_interface.h" 49 #include "components/drive/service/drive_service_interface.h"
50 #include "components/signin/core/browser/profile_oauth2_token_service.h" 50 #include "components/signin/core/browser/profile_oauth2_token_service.h"
51 #include "components/signin/core/browser/signin_manager.h" 51 #include "components/signin/core/browser/signin_manager.h"
52 #include "content/public/browser/browser_thread.h" 52 #include "content/public/browser/browser_thread.h"
53 #include "content/public/browser/storage_partition.h" 53 #include "content/public/browser/storage_partition.h"
54 #include "extensions/browser/extension_system.h" 54 #include "extensions/browser/extension_system.h"
55 #include "extensions/browser/extension_system_provider.h" 55 #include "extensions/browser/extension_system_provider.h"
56 #include "extensions/browser/extensions_browser_client.h" 56 #include "extensions/browser/extensions_browser_client.h"
57 #include "extensions/common/extension.h" 57 #include "extensions/common/extension.h"
58 #include "google_apis/drive/drive_api_url_generator.h" 58 #include "google_apis/drive/drive_api_url_generator.h"
59 #include "net/traffic_annotation/network_traffic_annotation.h"
59 #include "net/url_request/url_request_context_getter.h" 60 #include "net/url_request/url_request_context_getter.h"
60 #include "storage/browser/blob/scoped_file.h" 61 #include "storage/browser/blob/scoped_file.h"
61 #include "storage/common/fileapi/file_system_util.h" 62 #include "storage/common/fileapi/file_system_util.h"
62 63
63 namespace sync_file_system { 64 namespace sync_file_system {
64 65
65 class RemoteChangeProcessor; 66 class RemoteChangeProcessor;
66 67
67 namespace drive_backend { 68 namespace drive_backend {
68 69
70 constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation =
71 net::DefineNetworkTrafficAnnotation("sync_file_system", R"(
72 semantics {
73 sender: "Sync FileSystem Chrome API"
74 description:
75 "Sync FileSystem API provides an isolated FileSystem to Chrome "
76 "Apps. The contents of the FileSystem are automatically synced "
77 "among application instances through a hidden folder on Google "
78 "Drive. This service uploades or downloads these files for "
79 "synchronization."
80 trigger:
81 "When a Chrome App uses Sync FileSystem API, or when a file on "
82 "Google Drive is modified."
83 data:
84 "Files created by Chrome Apps via Sync FileSystem API."
85 destination: GOOGLE_OWNED_SERVICE
86 }
87 policy {
88 cookies_allowed: false
89 setting: "This feature cannot be disabled in settings."
90 policy_exception_justification: "Not implemented."
91 })");
92
69 std::unique_ptr<drive::DriveServiceInterface> 93 std::unique_ptr<drive::DriveServiceInterface>
70 SyncEngine::DriveServiceFactory::CreateDriveService( 94 SyncEngine::DriveServiceFactory::CreateDriveService(
71 OAuth2TokenService* oauth2_token_service, 95 OAuth2TokenService* oauth2_token_service,
72 net::URLRequestContextGetter* url_request_context_getter, 96 net::URLRequestContextGetter* url_request_context_getter,
73 base::SequencedTaskRunner* blocking_task_runner) { 97 base::SequencedTaskRunner* blocking_task_runner) {
74 return std::unique_ptr< 98 return std::unique_ptr<
75 drive::DriveServiceInterface>(new drive::DriveAPIService( 99 drive::DriveServiceInterface>(new drive::DriveAPIService(
76 oauth2_token_service, url_request_context_getter, blocking_task_runner, 100 oauth2_token_service, url_request_context_getter, blocking_task_runner,
77 GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction), 101 GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction),
78 GURL(google_apis::DriveApiUrlGenerator::kBaseThumbnailUrlForProduction), 102 GURL(google_apis::DriveApiUrlGenerator::kBaseThumbnailUrlForProduction),
79 std::string() /* custom_user_agent */)); 103 std::string(), /* custom_user_agent */
104 kTrafficAnnotation));
80 } 105 }
81 106
82 class SyncEngine::WorkerObserver : public SyncWorkerInterface::Observer { 107 class SyncEngine::WorkerObserver : public SyncWorkerInterface::Observer {
83 public: 108 public:
84 WorkerObserver(base::SequencedTaskRunner* ui_task_runner, 109 WorkerObserver(base::SequencedTaskRunner* ui_task_runner,
85 base::WeakPtr<SyncEngine> sync_engine) 110 base::WeakPtr<SyncEngine> sync_engine)
86 : ui_task_runner_(ui_task_runner), 111 : ui_task_runner_(ui_task_runner),
87 sync_engine_(sync_engine) { 112 sync_engine_(sync_engine) {
88 sequence_checker_.DetachFromSequence(); 113 sequence_checker_.DetachFromSequence();
89 } 114 }
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 798
774 SyncStatusCallback SyncEngine::TrackCallback( 799 SyncStatusCallback SyncEngine::TrackCallback(
775 const SyncStatusCallback& callback) { 800 const SyncStatusCallback& callback) {
776 return callback_tracker_.Register( 801 return callback_tracker_.Register(
777 base::Bind(callback, SYNC_STATUS_ABORT), 802 base::Bind(callback, SYNC_STATUS_ABORT),
778 callback); 803 callback);
779 } 804 }
780 805
781 } // namespace drive_backend 806 } // namespace drive_backend
782 } // namespace sync_file_system 807 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/drive_integration_service.cc ('k') | components/drive/service/drive_api_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698