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

Side by Side Diff: android_webview/native/android_protocol_handler.cc

Issue 2851673002: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: Created 3 years, 7 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 (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 "android_webview/native/android_protocol_handler.h" 5 #include "android_webview/native/android_protocol_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "android_webview/browser/net/android_stream_reader_url_request_job.h" 9 #include "android_webview/browser/net/android_stream_reader_url_request_job.h"
10 #include "android_webview/browser/net/aw_url_request_job_factory.h" 10 #include "android_webview/browser/net/aw_url_request_job_factory.h"
(...skipping 23 matching lines...) Expand all
34 using base::android::JavaParamRef; 34 using base::android::JavaParamRef;
35 using base::android::ScopedJavaGlobalRef; 35 using base::android::ScopedJavaGlobalRef;
36 using base::android::ScopedJavaLocalRef; 36 using base::android::ScopedJavaLocalRef;
37 37
38 namespace { 38 namespace {
39 39
40 void* kPreviouslyFailedKey = &kPreviouslyFailedKey; 40 void* kPreviouslyFailedKey = &kPreviouslyFailedKey;
41 41
42 void MarkRequestAsFailed(net::URLRequest* request) { 42 void MarkRequestAsFailed(net::URLRequest* request) {
43 request->SetUserData(kPreviouslyFailedKey, 43 request->SetUserData(kPreviouslyFailedKey,
44 new base::SupportsUserData::Data()); 44 base::MakeUnique<base::SupportsUserData::Data>());
45 } 45 }
46 46
47 bool HasRequestPreviouslyFailed(net::URLRequest* request) { 47 bool HasRequestPreviouslyFailed(net::URLRequest* request) {
48 return request->GetUserData(kPreviouslyFailedKey) != NULL; 48 return request->GetUserData(kPreviouslyFailedKey) != NULL;
49 } 49 }
50 50
51 class AndroidStreamReaderURLRequestJobDelegateImpl 51 class AndroidStreamReaderURLRequestJobDelegateImpl
52 : public AndroidStreamReaderURLRequestJob::Delegate { 52 : public AndroidStreamReaderURLRequestJob::Delegate {
53 public: 53 public:
54 AndroidStreamReaderURLRequestJobDelegateImpl(); 54 AndroidStreamReaderURLRequestJobDelegateImpl();
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 return ConvertUTF8ToJavaString(env, android_webview::kAndroidAssetPath); 248 return ConvertUTF8ToJavaString(env, android_webview::kAndroidAssetPath);
249 } 249 }
250 250
251 static ScopedJavaLocalRef<jstring> GetAndroidResourcePath( 251 static ScopedJavaLocalRef<jstring> GetAndroidResourcePath(
252 JNIEnv* env, 252 JNIEnv* env,
253 const JavaParamRef<jclass>& /*clazz*/) { 253 const JavaParamRef<jclass>& /*clazz*/) {
254 return ConvertUTF8ToJavaString(env, android_webview::kAndroidResourcePath); 254 return ConvertUTF8ToJavaString(env, android_webview::kAndroidResourcePath);
255 } 255 }
256 256
257 } // namespace android_webview 257 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/net/aw_request_interceptor.cc ('k') | android_webview/native/aw_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698