Changeset 52406 in webkit


Ignore:
Timestamp:
Dec 20, 2009 1:52:52 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-20 Andrei Popescu <andreip@google.com>

Reviewed by Adam Barth.

[Android] Android needs implementation of setCookies, cookies and cookiesEnabled functions.
https://bugs.webkit.org/show_bug.cgi?id=32559

Add implementation of the cookie functions.
Fix a crash caused by dereferencing a 0 MainResourceLoader pointer
in ResourceHandle::start().

No new tests, this is platform code.

  • platform/android/PlatformBridge.h:
  • platform/network/android/AuthenticationChallenge.h: Added.
  • platform/network/android/CookieJarAndroid.cpp: Added. (WebCore::setCookies): (WebCore::cookies): (WebCore::cookiesEnabled):
  • platform/network/android/ResourceHandleAndroid.cpp: (WebCore::ResourceHandle::start):
Location:
trunk/WebCore
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r52403 r52406  
     12009-12-20  Andrei Popescu  <andreip@google.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        [Android] Android needs implementation of setCookies, cookies and cookiesEnabled functions.
     6        https://bugs.webkit.org/show_bug.cgi?id=32559
     7
     8        Add implementation of the cookie functions.
     9        Fix a crash caused by dereferencing a 0 MainResourceLoader pointer
     10        in ResourceHandle::start().
     11
     12        No new tests, this is platform code.
     13
     14        * platform/android/PlatformBridge.h:
     15        * platform/network/android/AuthenticationChallenge.h: Added.
     16        * platform/network/android/CookieJarAndroid.cpp: Added.
     17        (WebCore::setCookies):
     18        (WebCore::cookies):
     19        (WebCore::cookiesEnabled):
     20        * platform/network/android/ResourceHandleAndroid.cpp:
     21        (WebCore::ResourceHandle::start):
     22
    1232009-12-19  Eric Seidel  <eric@webkit.org>
    224
  • trunk/WebCore/platform/android/PlatformBridge.h

    r51384 r52406  
    4949    static WTF::Vector<String> getSupportedKeyStrengthList();
    5050    static String getSignedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL&);
     51    // Cookies
     52    static void setCookies(const KURL&, const String& value);
     53    static String cookies(const KURL&);
     54    static bool cookiesEnabled();
    5155};
     56
    5257}
    5358#endif // PlatformBridge_h
  • trunk/WebCore/platform/network/android/AuthenticationChallenge.h

    r52404 r52406  
    11/*
    22 * Copyright 2009, The Android Open Source Project
     3 * Copyright (C) 2007 Apple Inc.  All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2425 */
    2526
    26 #ifndef PlatformBridge_h
    27 #define PlatformBridge_h
     27#ifndef AuthenticationChallenge_h
     28#define AuthenticationChallenge_h
    2829
    29 #include "KURL.h"
    30 #include "PlatformString.h"
    31 
    32 #include <wtf/Vector.h>
     30#include "AuthenticationChallengeBase.h"
    3331
    3432namespace WebCore {
    3533
    36 // An interface to the embedding layer, which has the ability to answer
    37 // questions about the system and so on...
    38 // This is very similar to ChromiumBridge and the two are likely to converge
    39 // in the future.
    40 //
    41 // The methods in this class all need to reach across a JNI layer to the Java VM
    42 // where the embedder runs. The JNI machinery is currently all in WebKit/android
    43 // but the long term plan is to move to the WebKit API and share the bridge and its
    44 // implementation with Chromium. The JNI machinery will then move outside of WebKit,
    45 // similarly to how Chromium's IPC layer lives outside of WebKit.
    46 class PlatformBridge {
    47 public:
    48     // KeyGenerator
    49     static WTF::Vector<String> getSupportedKeyStrengthList();
    50     static String getSignedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL&);
     34class AuthenticationChallenge : public AuthenticationChallengeBase {
    5135};
     36
    5237}
    53 #endif // PlatformBridge_h
     38
     39#endif
  • trunk/WebCore/platform/network/android/CookieJarAndroid.cpp

    r52404 r52406  
    11/*
    2  * Copyright 2009, The Android Open Source Project
     2 * Copyright 2007, The Android Open Source Project
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef PlatformBridge_h
    27 #define PlatformBridge_h
     26#include "config.h"
    2827
    29 #include "KURL.h"
    30 #include "PlatformString.h"
     28#include "CookieJar.h"
    3129
    32 #include <wtf/Vector.h>
     30#include "PlatformBridge.h"
    3331
    3432namespace WebCore {
    3533
    36 // An interface to the embedding layer, which has the ability to answer
    37 // questions about the system and so on...
    38 // This is very similar to ChromiumBridge and the two are likely to converge
    39 // in the future.
    40 //
    41 // The methods in this class all need to reach across a JNI layer to the Java VM
    42 // where the embedder runs. The JNI machinery is currently all in WebKit/android
    43 // but the long term plan is to move to the WebKit API and share the bridge and its
    44 // implementation with Chromium. The JNI machinery will then move outside of WebKit,
    45 // similarly to how Chromium's IPC layer lives outside of WebKit.
    46 class PlatformBridge {
    47 public:
    48     // KeyGenerator
    49     static WTF::Vector<String> getSupportedKeyStrengthList();
    50     static String getSignedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL&);
    51 };
     34void setCookies(Document*, const KURL& url, const String& value)
     35{
     36    PlatformBridge::setCookies(url, value);
    5237}
    53 #endif // PlatformBridge_h
     38
     39String cookies(const Document*, const KURL& url)
     40{
     41    return PlatformBridge::cookies(url);
     42}
     43
     44bool cookiesEnabled(const Document*)
     45{
     46    return PlatformBridge::cookiesEnabled();
     47}
     48
     49}
  • trunk/WebCore/platform/network/android/ResourceHandleAndroid.cpp

    r52123 r52406  
    5353    DocumentLoader* docLoader = frame->loader()->activeDocumentLoader();
    5454    MainResourceLoader* mainLoader = docLoader->mainResourceLoader();
    55     bool isMainResource = (mainLoader->handle() == this);
     55    bool isMainResource = mainLoader && (mainLoader->handle() == this);
    5656
    5757    PassRefPtr<ResourceLoaderAndroid> loader = ResourceLoaderAndroid::start(this, d->m_request, frame->loader()->client(), isMainResource, false);
Note: See TracChangeset for help on using the changeset viewer.