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

Side by Side Diff: components/html_viewer/web_cookie_jar_impl.cc

Issue 1157573002: Revert "Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/html_viewer/web_cookie_jar_impl.h" 5 #include "components/html_viewer/web_cookie_jar_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "third_party/WebKit/public/platform/WebURL.h" 8 #include "third_party/WebKit/public/platform/WebURL.h"
9 9
10 using mojo::String; 10 using mojo::String;
(...skipping 25 matching lines...) Expand all
36 store_->Set(url.string().utf8(), cookie.utf8(), 36 store_->Set(url.string().utf8(), cookie.utf8(),
37 base::Bind(&CopyBool, &success)); 37 base::Bind(&CopyBool, &success));
38 38
39 // Wait to ensure the cookie was set before advancing. That way any 39 // Wait to ensure the cookie was set before advancing. That way any
40 // subsequent URL request will see the changes to the cookie store. 40 // subsequent URL request will see the changes to the cookie store.
41 // 41 //
42 // TODO(darin): Consider using associated message pipes for the CookieStore 42 // TODO(darin): Consider using associated message pipes for the CookieStore
43 // and URLLoader, so that we could let this method call run asynchronously 43 // and URLLoader, so that we could let this method call run asynchronously
44 // without suffering an ordering problem. See crbug/386825. 44 // without suffering an ordering problem. See crbug/386825.
45 // 45 //
46 store_.WaitForIncomingResponse(); 46 store_.WaitForIncomingMethodCall();
47 } 47 }
48 48
49 blink::WebString WebCookieJarImpl::cookies( 49 blink::WebString WebCookieJarImpl::cookies(
50 const blink::WebURL& url, 50 const blink::WebURL& url,
51 const blink::WebURL& first_party_for_cookies) { 51 const blink::WebURL& first_party_for_cookies) {
52 String result; 52 String result;
53 store_->Get(url.string().utf8(), base::Bind(&CopyString, &result)); 53 store_->Get(url.string().utf8(), base::Bind(&CopyString, &result));
54 54
55 // Wait for the result. Since every outbound request we make to the cookie 55 // Wait for the result. Since every outbound request we make to the cookie
56 // store is followed up with WaitForIncomingResponse, we can be sure that 56 // store is followed up with WaitForIncomingMethodCall, we can be sure that
57 // the next incoming method call will be the response to our request. 57 // the next incoming method call will be the response to our request.
58 store_.WaitForIncomingResponse(); 58 store_.WaitForIncomingMethodCall();
59 if (!result) 59 if (!result)
60 return blink::WebString(); 60 return blink::WebString();
61 61
62 return blink::WebString::fromUTF8(result); 62 return blink::WebString::fromUTF8(result);
63 } 63 }
64 64
65 blink::WebString WebCookieJarImpl::cookieRequestHeaderFieldValue( 65 blink::WebString WebCookieJarImpl::cookieRequestHeaderFieldValue(
66 const blink::WebURL& url, 66 const blink::WebURL& url,
67 const blink::WebURL& first_party_for_cookies) { 67 const blink::WebURL& first_party_for_cookies) {
68 return cookies(url, first_party_for_cookies); 68 return cookies(url, first_party_for_cookies);
69 } 69 }
70 70
71 } // namespace html_viewer 71 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/html_viewer/web_clipboard_impl.cc ('k') | components/resource_provider/public/cpp/resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698