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

Side by Side Diff: chrome/browser/chromeos/external_cookie_handler.cc

Issue 328006: Fix compile bustage on chromeos builder. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/chromeos/external_cookie_handler.h" 5 #include "chrome/browser/chromeos/external_cookie_handler.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/chromeos/pipe_reader.h" 8 #include "chrome/browser/chromeos/pipe_reader.h"
9 #include "chrome/browser/net/url_request_context_getter.h"
9 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
10 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
11 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
12 #include "net/base/cookie_store.h" 13 #include "net/base/cookie_store.h"
13 #include "net/url_request/url_request_context.h" 14 #include "net/url_request/url_request_context.h"
14 15
15 void ExternalCookieHandler::GetCookies(const CommandLine& parsed_command_line, 16 void ExternalCookieHandler::GetCookies(const CommandLine& parsed_command_line,
16 Profile* profile) { 17 Profile* profile) {
17 // If there are Google External SSO cookies, add them to the cookie store. 18 // If there are Google External SSO cookies, add them to the cookie store.
18 if (parsed_command_line.HasSwitch(switches::kCookiePipe)) { 19 if (parsed_command_line.HasSwitch(switches::kCookiePipe)) {
19 std::string pipe_name = 20 std::string pipe_name =
20 WideToASCII(parsed_command_line.GetSwitchValue(switches::kCookiePipe)); 21 WideToASCII(parsed_command_line.GetSwitchValue(switches::kCookiePipe));
21 ExternalCookieHandler cookie_handler(new PipeReader(pipe_name)); 22 ExternalCookieHandler cookie_handler(new PipeReader(pipe_name));
22 cookie_handler.HandleCookies( 23 cookie_handler.HandleCookies(
23 profile->GetRequestContext()->cookie_store()); 24 profile->GetRequestContext()->GetCookieStore());
24 } 25 }
25 } 26 }
26 27
27 // static 28 // static
28 const char ExternalCookieHandler::kGoogleAccountsUrl[] = 29 const char ExternalCookieHandler::kGoogleAccountsUrl[] =
29 "https://www.google.com/a/google.com/acs"; 30 "https://www.google.com/a/google.com/acs";
30 31
31 const int kChunkSize = 256; 32 const int kChunkSize = 256;
32 33
33 // Reads up to a newline, or the end of the data, in increments of |chunk| 34 // Reads up to a newline, or the end of the data, in increments of |chunk|
(...skipping 28 matching lines...) Expand all
62 std::string cookie_line = ReadLine(kChunkSize); 63 std::string cookie_line = ReadLine(kChunkSize);
63 while (!cookie_line.empty()) { 64 while (!cookie_line.empty()) {
64 if (!cookie_store->SetCookieWithOptions(url, cookie_line, options)) 65 if (!cookie_store->SetCookieWithOptions(url, cookie_line, options))
65 return false; 66 return false;
66 cookie_line = ReadLine(kChunkSize); 67 cookie_line = ReadLine(kChunkSize);
67 } 68 }
68 return true; 69 return true;
69 } 70 }
70 return false; 71 return false;
71 } 72 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698