Chromium Code Reviews| Index: chrome/browser/chromeos/arc/fileapi/intent_helper_util.cc |
| diff --git a/chrome/browser/chromeos/arc/fileapi/intent_helper_util.cc b/chrome/browser/chromeos/arc/fileapi/intent_helper_util.cc |
| index 4b66f75bc38f5641bf45f1efed5fbc781a13e407..947e6fcda4ed0808762218d5b6f04ea3f9ed578c 100644 |
| --- a/chrome/browser/chromeos/arc/fileapi/intent_helper_util.cc |
| +++ b/chrome/browser/chromeos/arc/fileapi/intent_helper_util.cc |
| @@ -13,17 +13,14 @@ namespace intent_helper_util { |
| namespace { |
| -void OnGetFileSize( |
| - const mojom::IntentHelperInstance::GetFileSizeCallback& callback, |
| - int64_t size) { |
| +void OnGetFileSize(const GetFileSizeCallback& callback, int64_t size) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, |
| base::Bind(callback, size)); |
| } |
| -void GetFileSizeOnUIThread( |
| - const GURL& arc_url, |
| - const mojom::IntentHelperInstance::GetFileSizeCallback& callback) { |
| +void GetFileSizeOnUIThread(const GURL& arc_url, |
| + const GetFileSizeCallback& callback) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| auto* arc_bridge_service = arc::ArcBridgeService::Get(); |
| if (!arc_bridge_service) { |
| @@ -32,28 +29,26 @@ void GetFileSizeOnUIThread( |
| return; |
| } |
| mojom::IntentHelperInstance* intent_helper_instance = |
| - arc_bridge_service->intent_helper()->GetInstanceForMethod("GetFileSize", |
| - 15); |
| + arc_bridge_service->intent_helper()->GetInstanceForMethod( |
| + "GetFileSizeDeprecated", 15); |
|
Yusuke Sato
2016/11/21 16:52:30
nit: not your fault, but can you name the constant
Yusuke Sato
2016/11/21 17:49:01
sorry, typo. I meant 'constexpr uint32_t kXXX'.
Shuhei Takahashi
2016/11/22 08:55:42
Done.
|
| if (!intent_helper_instance) { |
| LOG(ERROR) << "Failed to get IntentHelperInstance."; |
| OnGetFileSize(callback, -1); |
| return; |
| } |
| - intent_helper_instance->GetFileSize(arc_url.spec(), |
| - base::Bind(&OnGetFileSize, callback)); |
| + intent_helper_instance->GetFileSizeDeprecated( |
| + arc_url.spec(), base::Bind(&OnGetFileSize, callback)); |
| } |
| -void OnOpenFileToRead( |
| - const mojom::IntentHelperInstance::OpenFileToReadCallback& callback, |
| - mojo::ScopedHandle handle) { |
| +void OnOpenFileToRead(const OpenFileToReadCallback& callback, |
| + mojo::ScopedHandle handle) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, |
| base::Bind(callback, base::Passed(&handle))); |
| } |
| -void OpenFileToReadOnUIThread( |
| - const GURL& arc_url, |
| - const mojom::IntentHelperInstance::OpenFileToReadCallback& callback) { |
| +void OpenFileToReadOnUIThread(const GURL& arc_url, |
| + const OpenFileToReadCallback& callback) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| auto* arc_bridge_service = arc::ArcBridgeService::Get(); |
| if (!arc_bridge_service) { |
| @@ -63,30 +58,28 @@ void OpenFileToReadOnUIThread( |
| } |
| mojom::IntentHelperInstance* intent_helper_instance = |
| arc_bridge_service->intent_helper()->GetInstanceForMethod( |
| - "OpenFileToRead", 15); |
| + "OpenFileToReadDeprecated", 15); |
|
Yusuke Sato
2016/11/21 16:52:30
same
Shuhei Takahashi
2016/11/22 08:55:42
Done.
|
| if (!intent_helper_instance) { |
| LOG(ERROR) << "Failed to get IntentHelperInstance."; |
| OnOpenFileToRead(callback, mojo::ScopedHandle()); |
| return; |
| } |
| - intent_helper_instance->OpenFileToRead( |
| + intent_helper_instance->OpenFileToReadDeprecated( |
| arc_url.spec(), base::Bind(&OnOpenFileToRead, callback)); |
| } |
| } // namespace |
| -void GetFileSizeOnIOThread( |
| - const GURL& arc_url, |
| - const mojom::IntentHelperInstance::GetFileSizeCallback& callback) { |
| +void GetFileSizeOnIOThread(const GURL& arc_url, |
| + const GetFileSizeCallback& callback) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| content::BrowserThread::PostTask( |
| content::BrowserThread::UI, FROM_HERE, |
| base::Bind(&GetFileSizeOnUIThread, arc_url, callback)); |
| } |
| -void OpenFileToReadOnIOThread( |
| - const GURL& arc_url, |
| - const mojom::IntentHelperInstance::OpenFileToReadCallback& callback) { |
| +void OpenFileToReadOnIOThread(const GURL& arc_url, |
| + const OpenFileToReadCallback& callback) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| content::BrowserThread::PostTask( |
| content::BrowserThread::UI, FROM_HERE, |